Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I create a checkbox in a grid column at runtime?
Message
From
30/04/2002 08:48:15
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/04/2002 08:18:35
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00650796
Message ID:
00650802
Views:
20
This message has been marked as the solution to the initial question of the thread.
>I'm working on an application written in VFP 5.0 and have a grid on a form which I create at runtime. I need to change the controlsource to checkbox instead of textbox (see code below)
>
>THISFORM.grid1.ADDCOLUMN(2)
>THISFORM.grid1.COLUMNS(2).NAME = 'colBox'
>THISFORM.GRID1.colBox.WIDTH = 30
>THISFORM.grid1.colBox.HEADER1.CAPTION = ''
>THISFORM.grid1.colBox.HEADER1.ALIGNMENT = 2
>THISFORM.grid1.colBox.currentcontrol = 'Check1'
>
>My code errors out on the last line. What am I doing wrong?
>
>Thanks,
>
>Joe
with THISFORM.grid1
 .AddColumn(2)
 with .COLUMNS(.columncount)
  .NAME = 'colBox'
  .Controlsource = "myTable.myLogicalField"
  .WIDTH = 30
  .HEADER1.CAPTION = ''
  .HEADER1.ALIGNMENT = 2
  .AddObject('Check1','CheckBox')
  .Check1.Caption = ''
  .Check1.Visible=.t.
  .currentcontrol = 'Check1'
  .Sparse = .f.
 endwith
endwith
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform