Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Checkbox to a Grid... 3

Status
Not open for further replies.

xBaseDude

MIS
Jan 31, 2002
357
0
0
US
Hi! Could someone explain to me how to add a checkbox (image) to the textbox in a grid based on a logical datatype?

IOW if .T. show a checkbox checked... if .F. just show the square box.

Is this done with a wingdings font, or a gif?

Whenever I've pursued this question on the web, the authors seem to cover listboxes and not grids.

TIA - Wayne
 
xBaseDude

Is there a reason you cannot use a checkbox control in the grid column?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Wayne

Make sure you have the Form Controls Toolbar visible.

Right click on the grid and select Edit.

Left click on the checkbox in the Form Controls Toolbar, and then left click in the column where you wish to place the checkbox.

In the selected column under the Data tab, set Sparse = .F.

Set ReadOnly = .F. if needed and assign ControlSource to a logical field in a table.


To remove the checkbox, select the checkbox in the properties sheet, click on the titlebar of the Form Designer and hit the delete key.

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander[sup]tm[/sup].com
PDFcommander[sup]tm[/sup].co.uk


 
Mike and Chris, Thanx for taking the time to help me with this.

My copy is VFP70

"Make sure you have the Form Controls Toolbar visible."
Okay...No Trouble

"Right click on the grid and select Edit."
Okay...No Trouble...Light Blue box appears around grid

"Left click on the checkbox in the Form Controls Toolbar, and then left click in the column where you wish to place the checkbox."

Trouble....Although I select the checkbox from the forms control toolbar, the (mouse) cursor does not change to the "crosshair" symbol indicating I am about paste something. Just the standard "I" beam. Left clicking in the textbox of the column does not appear to paste the checkbox control, however when viewing the properties sheet, I see that it's there. Playing with the background "opacity" property and changing to "transparent" seems to have no effect.

Any idea, where I've missed on your crystal clear instructions?

Regards - Wayne

 
it's there alright except that you should change CurrentControl property of that column to the object you just pasted (the checkbox). also set the column's Sparse property to .F.

i hope this helps. peace! [peace]

kilroy [trooper]
philippines

"Illegitimis non carborundum!"
 
Chris, Kilroy!

change CurrentControl property of that column to the object you just pasted (the checkbox)

Much Joy Kilroy! That was the missing link!

Can't tell you guys how long I've searched for this info.

I love Tek-Tips!

Regards - Wayne
Let there be peace on earth, let it begin with me
 
thanks for the star. but i also wouldn't have known it if not for all the great tipmasters here! (sir chris included) [wink]

just glad to help someone in need. peace! [peace]

kilroy [trooper]
philippines

"Illegitimis non carborundum!"
 
Wayne

Thanks also for the star and apologies for the omission. [blush]

Glad torturedmind was around to resolve the issue for you. [smile]

Incidentally the removal routine also works for the redundant textbox in the column if you like to be squeaky clean.




FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander[sup]tm[/sup].com
PDFcommander[sup]tm[/sup].co.uk


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top