Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How add event Click in grid (run time)
Message
From
10/08/2001 07:04:48
 
 
To
10/08/2001 06:54:41
Mario Felisbino
Construtora Andrade Gutierrez S/A
São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00542192
Message ID:
00542196
Views:
26
Hi!

Make your own text box class, than replace default text box in grid by your own text box in run time by following code in grid Init (or after each refresh of grid that cause rebuilding):
for i = 1 to this.ColumnCount
  with this.Columns(i)
    .AddObject('Text2','MyTextBoxClass') && 'MyTextBoxClass' is a class name of your textbox class
    .Text2.Visible = .T.
    .CurrentControl = 'Text2'
    .Text1.Visible = .F.
    .RemoveObject('Text1')
    .Text2.Name = 'Text1'
  endwith
endfor
Than in the class call some generic method of the form, for example
* click event of textbox class
if PEMSTATUS(thisform,'GridClick',5) && check if method exists
  thisform.GridClick(this)
endif
Finally, create custom method on the form and put your code for clicks in grid there. Note that in my sample reference to textbox object is passed to the GridClick method to identify the column clicked (you can remove this if not needed).

HTH.

>How add event click in grid:
>
>thisform.grid1.column1.text1
>
>in run time?
>
>Thank's
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform