Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I bind events to the browse window on the fly?
Message
 
 
To
19/11/2001 08:35:13
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00583378
Message ID:
00583431
Views:
30
>In another thread i read that you can bind events to the _screen object. Can something similar be done with the browse window?? Thats for quick and dirty solutions, when you dont have the luxury to make a grid in order to manipulate the events...
>
>Thank You

Yes you can. Ex.
local logridmonitor
browse name loMyGrid nowait
logridmonitor = createobject('CusGrdMonitor')
browse last
return

define class cusGrdMonitor as Custom
oGrid = loMyGrid

procedure Destroy
THIS.oGrid = .NULL.
endproc

procedure oGrid.Column1.Resize
	wait window transform(THIS.Width)  && THIS is an object reference to Column1
endproc

procedure oGrid.AfterRowColChange
lparameters nColIndex
	wait window transform(nColIndex)
endproc
enddefine
There is a problem with this code. It leaves an object reference somewhere to the Grid object specified in the Name clause and the Browse window remains displayed. It isn't active and you can't make it active. If you issue a CLEAR ALL, it releases it. This may have something to do with the unreleased object reference in an Assign method bug reported here a month or so ago.

Because of this, I would recommend going along with Vlad's suggestion of actually using a Grid.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform