Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I add an object to a class at design time?
Message
From
30/05/2005 05:12:01
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01018288
Message ID:
01018493
Views:
8
Two intellisense cheats:
Define Class myForm2 As myForm
   #Define That Thisform.TextBox1
   PROCEDURE Click()
      #If .f.
        LOCAL That As TextBox
        LOCAL TextBox1 As TextBox 
      #Endif
      
      * type . after That:
      That
      
      * type . after TextBox1:
      Thisform. TextBox1
   ENDPROC 
EndDefine 

Define Class myForm As Form
   PROCEDURE Init()
      Thisform.AddObject("TextBox1","TextBox")
   ENDPROC 
EndDefine
Either you shorten A.B (in this case thisfrom.textbox1) with a deifinition of "that"
or you define B (in this case textbox1) alone. The second trick needs the textbox1 "variable" to be seperate from A., so you type A. B. and have intellisense for class B and only need to remove the space between Thisform. and Textbox1 afterwards.

Bye, Olaf.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform