Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids created in Form Designer
Message
 
To
11/05/1998 11:19:16
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00098500
Message ID:
00098516
Views:
29
>My grid is created in the Form Designer with only 1 column. The columns are added programmatically during form init. How do I then add code to the Column.Resized event?
Mark,

You cannot add code at runtime. However, you can create your own column classes in a prg with the cod already in them, like this;
 * My column classes
 DEFINE CLASS colPlain AS Column
   Editable = .F.
   PROCEDURE StartEdit
       THIS.Editable = .T.
   END PROC

 ENDDEFINE

 DEFINE colGreenBar AS colPlain
    DynamicBackColor = IIF(RECNO()%2=0,RGB(0,255,0),RGB(255,25,255)
 ENDDEFINE

 DEFINE CLASS ColResizer AS colGreenBar
    PROCDURE Resize
       THIS.Text1.FontSize = Blah Blah Blah
    ENDPROC
 ENDDEFINE
Then in the Init of your form you simply;
 SET CLASSLIB TO Columns.prg ADDITIVE
 WITH THISFORM.Grid1
    .AddObject("Column2","colResizer")
    .AddObject("Column3","colResizer")
   ...
 ENDWITH
Previous
Reply
Map
View

Click here to load this message in the networking platform