|
-
Apr 7th, 2006, 07:43 AM
#1
Thread Starter
Just Married
How to compare flexgrid colour value
I am using a flex grid
i Want that if flexgrid cell colour =red then it show that it is red colour but how it is possible.........
Any idea
VB Code:
If Grid.CellBackColor) = vbRed Then
msgbox "It is Red Colour",vbinformation
End If
problem is thatit is showing value of gridbackcolor=0 but vbred value=255 there is alredy flexgrid is in red colour............
help me..........
-
Apr 7th, 2006, 08:01 AM
#2
Re: How to compare flexgrid colour value
You have to assign the backcolor using MSFlexGrid1.CellBackColor = VbRed, then get it with MSFlexGrid1.CellBackColor. If you select a backcolor in design mode, it won't work when using MSFlexGrid1.CellBackColor to show that color. So simply make a selection, and assign a color..
VB Code:
With MSFlexGrid1
.Redraw = False
.FillStyle = flexFillRepeat
.Row = 1
.RowSel = .Rows -1
.Col = 1
.ColSel = .Cols -1
.CellBackColor = vbRed
.FillStyle = flexFillSingle
.Redraw = True
'Show cellbackcolor in (1,1)
.Row = 1
.Col = 1
MsgBox .CellBackColor
End With
-
Apr 7th, 2006, 08:13 AM
#3
Re: How to compare flexgrid colour value
it doesn't matter when color was assigned (design or runtime) - the trick is to explicitly navigate to cell you need (set row/col) before calling any of the cell's properties (color, font, etc):
VB Code:
Grid.Col = 2
Grid.Row = 3
If Grid.CellBackColor = vbRed Then
MsgBox "It is Red Colour",vbinformation
Else
'...
End If
-
Apr 7th, 2006, 01:02 PM
#4
Re: How to compare flexgrid colour value
 Originally Posted by RhinoBull
it doesn't matter when color was assigned (design or runtime) - the trick is to explicitly navigate to cell you need (set row/col) before calling any of the cell's properties (color, font, etc):
VB Code:
Grid.Col = 2
Grid.Row = 3
If Grid.CellBackColor = vbRed Then
MsgBox "It is Red Colour",vbinformation
Else
'...
End If
Did you try that? if the backcolor is not asigned with cellbackcolor, then there CellBackColor is always 0.
-
Apr 8th, 2006, 05:17 AM
#5
Thread Starter
Just Married
Re: How to compare flexgrid colour value
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
|