Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding objects
Message
De
08/04/2003 03:23:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/04/2003 17:28:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00774920
Message ID:
00775006
Vues:
16
>I have been trying to add command buttons to a form on the fly. I have the command button names in a table and want the form to create the buttons.
>Problem: How do I tell the click event what I want it to do. I am trying to do this inside the form and it will not allow me to set information to the click. Any ideas?
>Thanks

Michael,
Define a command button that'd call an external program. ie:
*Add button on the fly
thisform.NewObject('onthefly','myCommandButton','mybutton.prg')
with thisform.onthefly
  .tag = sys(2015)
  set textmerge to (.tag+'.prg') noshow
  set textmerge on
    \lparameters toForm
    \wait window toForm.Name
  set textmerge to
  set textmerge off
  compile (.tag+'.prg')
endwith

* MyButton.prg
define class myCommandButton as CommandButton
procedure Click
 do (this.tag) with thisform
endproc
procedure destroy
 erase (this.tag+'.*')
endproc
enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform