Re: Controls in a msflexgrid
You don't have to use Textbox for editing cells - link in my signature will "take" to a thread with multiple flexgrid tips and tricks.
Also, cell style usually goes by the column - not byt the row.
Re: Controls in a msflexgrid
Quote:
Originally Posted by RhinoBull
You don't have to use Textbox for editing cells - link in my signature will "take" to a thread with multiple flexgrid tips and tricks.
Also, cell style usually goes by the column - not byt the row.
Hi RB, interesting tips, indeed.
Now, the main reason I use a textbox is I want to have the possibility to select the text, as the textbox has the SelStart and SelLength properties. Can you do that somehow with the flexgrid alone? If I want to change a cell's contents I hate having to delete the characters one by one -to be sure I can use the mouse e.g. clear the cell by right clicking, but I want to be able to do it with the keyboard as well...
Re: Controls in a msflexgrid
Quote:
in another row an array of checkboxes and finally, a row has an array of (2 per cell) radio buttons.
Also, rather than using controls, you can easily simulate CheckBoxes and Option buttons using symbolic fonts.
VB Code:
Private Sub Form_Load()
With Me.MSFlexGrid1
.Cols = 3
.Rows = 20
.ColWidth(0) = 300
.ColWidth(1) = 1200
.ColWidth(2) = 400
.FillStyle = flexFillRepeat
.Row = 1
.Col = 2
.RowSel = .Rows - 1
.CellFontName = "Wingdings"
.CellFontSize = 16
.ColAlignment(2) = flexAlignCenterCenter
.Text = "q"
.FillStyle = flexFillSingle
.Row = 1
.Col = 1
End With
End Sub
Private Sub MSFlexGrid1_Click()
With MSFlexGrid1
If .MouseCol = 2 Then
If .TextMatrix(.Row, 2) = "q" Then
.TextMatrix(.Row, 2) = "รพ"
Else
.TextMatrix(.Row, 2) = "q"
End If
End If
End With
End Sub
Re: Controls in a msflexgrid
I'm wondering if it's worth using this control rather than the msflexgrid.
Looks like there's a large amount of information to read before you can get going, so I'd like to hear from anyone who may have used it.
Re: Controls in a msflexgrid
Quote:
Originally Posted by brucevde
Also, rather than using controls, you can easily simulate CheckBoxes and Option buttons using symbolic fonts.
[/Highlight]
If I have 2 radio buttons in the same cell, how do I go about simulating the click events? Do I have to check the mouse coordinates in the flexgrid's MouseMove event? May be a bit cumbersome, unless you assure me it really isn't...
Re: Controls in a msflexgrid
To be continued in this new thread.