Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I bind events to the browse window on the fly?
Message
 
 
À
19/11/2001 08:35:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00583378
Message ID:
00583431
Vues:
32
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform