![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
Trouble to select many rows on a MSFlexGrid
I need urgent help I need to select many entire rows not cells of my MSFlexGrid pressing CTL just like Excel does.
Thanks for helping me. best regards |
|
|
|
|
|
#2 |
|
Expert Programmer
|
The current position (cursor) of the grid is given by (row, col). Thus the selection is defined in terms of another point (rowsel, colsel) that defines the selection vector. Note that the latter does not necessarily need to be to the bottom right of the cursor.
Here's a neat function that'll select a row: Public Sub SelectARow(ByRef FG As MSFlexGrid, ByVal Index As Long)
With FG
.Row = Index ' Top of selection
.RowSel = Index ' Bottom of selection
.Col = 0 ' Left of selection (left-most column)
.ColSel = .Cols - 1 ' Right of selection (right-most column)
' N.B. Index here begins at 0 not 1
End With
End SubSo for example: Private Sub Form_Click() SelectARow MSFlexGrid1, 4 End Sub Hope you find this helpful. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
Thanks but what i want is....
If you open Excel one click on the fixed col where the row numbers are, then press Ctrl on another consecutive or non-consecutive row see what happens, now i selected two rows if i select another row without pressing Ctrl the new row gets selected and every other row that i had select before is not selected anymore
that is want to do in my msflexgrid Thanks 4 your time I hope u can help me again |
|
|
|
|
|
#4 |
|
Expert Programmer
|
Sorry: selections in the FlexiGrid have to be continuous (i.e. a rectangle shape) so you can't have a selection made up of separate areas, or polygonal selections. This would bloat and complicate a control that is designed to simply represent a collection of data as efficiently as possible.
If you want to allow polygonal selections, focus bands, dual and meta data (e.g. for formulas) then you're writing a spreadsheet not a grid. There may be some obscure activeX control that does it, but certainly not one from Microsoft. I would suggest either using a spreadsheet OLE object provided by OpenOffice or Microsoft Office (Components -> Insertable Objects) or writing your own control from scratch. |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
Thanks
Thanku Rory i apreciate it so much
BYE ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|