|
-
Nov 24th, 2005, 06:08 PM
#1
Thread Starter
Addicted Member
MSFlexgrid help needed plz
After merging the columns...say i have three columns and the first column is merged.. when i click on any row it does not get high lighted..also the width of my first column is 0 so that it is not shown to the user..how ever when i make it visible to the user and click on the rows the first column appears to be highlighted..like the border color changes to but the cell inside is not highlighted..
is there are a way the when a user clicks on the row..that paticular row gets highlighted..
i'll really appreciate any help in this matter
-
Nov 24th, 2005, 06:16 PM
#2
Re: MSFlexgrid help needed plz
You highlight it manually changing that row backcolor, you can find an example about this and other Flexgrid tricks in This Post
-
Nov 24th, 2005, 06:39 PM
#3
Thread Starter
Addicted Member
Re: MSFlexgrid help needed plz
ok i get a good understanding..with that..i have seen that earlier but did not have any clue..so can u tell me ..if i have four columns and 4 rows then if i click any of them then using a loop..can i change color of row columns for example 0 to 3
thanx
-
Nov 24th, 2005, 07:20 PM
#4
Re: MSFlexgrid help needed plz
try this..
VB Code:
Private Sub MSFlexGrid1_Click()
Static iLastRow As Integer
With MSFlexGrid1
.Redraw = False
.FillStyle = flexFillRepeat 'To extend the selection
If iLastRow <> 0 Then
.Row = iLastRow
.RowSel = iLastRow
.Col = 0
.ColSel = .Cols - 1
.CellBackColor = .BackColor
End If
.Row = .MouseRow
.RowSel = .MouseRow
.Col = 0
.ColSel = .Cols - 1
.CellBackColor = &H80000018
.FillStyle = flexFillSingle
.Redraw = True
iLastRow = .MouseRow
End With
End Sub
And this is a Merge example, its merges 6 cells..
VB Code:
Private Sub Form_Load()
Dim i As Integer
With MSFlexGrid1
.SelectionMode = flexSelectionByRow
.Rows = 10
.Cols = 10
.FixedCols = 0 'Here I select No fixed Cols, you can change it
.MergeCells = flexMergeFree
.MergeRow(1) = True: .MergeRow(2) = True
For i = 1 To 2
.TextMatrix(i, 1) = "Merging This"
.TextMatrix(i, 2) = "Merging This"
.TextMatrix(i, 3) = "Merging This"
Next
.Row = 1: .Col = 1
.CellAlignment = flexAlignCenterCenter
.Row = 2: .Col = 1
.CellAlignment = flexAlignCenterCenter
End With
End Sub
Last edited by jcis; Nov 24th, 2005 at 07:26 PM.
-
Nov 24th, 2005, 07:23 PM
#5
Thread Starter
Addicted Member
Re: MSFlexgrid help needed plz
you are a legend...thanx for that..you saved a hell of my time..and one last thing what does mouserow means
-
Nov 24th, 2005, 07:33 PM
#6
Re: MSFlexgrid help needed plz
.MouseRow is the Row where you clicked with the mouse,
.MouseCol is the Col where you clicked with the mouse.
I edited my post and added center Alignment to merged cells.
With .FillStyle = flexFillRepeat the cellbackground color change apply to all selected cells, but you have to restore to normal after that with .FillStyle = flexFillSingle, as in the example.
.SelectionMode must be flexSelectionByRow, else its not very easy to align text (it moves the first time).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|