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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MsFlexGrid and Checkboxes

Status
Not open for further replies.

zann

Programmer
Nov 7, 2002
7
0
0
ZA
Is it possible to have a checkbox in a cell(s) of an Msflexgrid? i have been trying to find some help on the net but no luck. any sample code would greatly be appreciated!Thanx in advance zann.
 
The only thing that you can do is to create floating check boxes much the same way as you create floating text boxes. The check box will sit on top of a specific cell and the user will think that it is part of the grid.

The check box .value property would have to be set manually.

Search this forum for 'MSFlexgrid' and/or 'floating text box' and you should find some examples. Thanks and Good Luck!

zemp
 
not sure if this is what you want but...

if you want a column of checkboxes, one for each row then you could use the mousecol and mouserow properties of the flexgrid in the click event

code would be something like:
(if column 10 is your column of "checkboxes")

private sub grid_click()

if grid.mousecol=10 then

if grid.textmatrix(grid.mouserow,grid.mousecol)="X" then
grid.textmatrix(grid.mouserow,grid.mousecol)=""
else
grid.textmatrix(grid.mouserow,grid.mousecol)="X"
end if

end if

end sub

This will give you a check box effect - clicking on the grid in row 10 toggles an X in it - then you can look at the value in the grid to see which rows have been checked.

(most of this I picked up from Mike James in Computer Shopper magazine in the UK a while back)


Hope its useful, otherwise feel free to ignore
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top