Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How add event Click in grid (run time)
Message
 
 
À
10/08/2001 06:54:41
Mario Felisbino
Construtora Andrade Gutierrez S/A
São Paulo, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00542192
Message ID:
00542196
Vues:
24
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform