Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding code to events programmatically
Message
De
09/02/2016 13:39:36
 
 
À
09/02/2016 13:21:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01631115
Message ID:
01631118
Vues:
77
The problem is you need to recompile the form to get the event code to work. As Boislav said, BindEvents should work.

I'm more curious about the need to programmatically add the list box. Is it something you can put on the form in the designer then hide it when not needed?


>I use the form designer always, but I have come across a situation where I need to add a listbox to a form programmatically. This I got right, and it pops up at the right time, etc, but I need help in where, and how to add the events code. This lot pops up the box. Where in relation to this do I put the events code? Many thanks!
>
>
>			thisform.AddObject('oList1','ListBox')
>			with thisform.oList1
>			   .rowSource = "oldjobs"
>			   .rowsourcetype=2
>			   .visible=.t.
>			   .top=186
>			   .left=350
>			   .width=250
>			   .columncount=2
>			   .columnwidths='150,75'
>			   .SelectedItemBackColor=RGB(70,60,50)
>			   .SelectedItemForeColor=RGB(10,191,160)
>			   .SpecialEffect=1
>			   .ItemBackColor=RGB(40,40,40)
>			   .ItemForeColor=RGB(255,204,153)
>			   .BorderStyle = 1
>			   .BorderColor=RGB(235,132,0)
>			endwith
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform