|
-
Apr 9th, 2007, 01:43 AM
#1
Thread Starter
Member
[RESOLVED] flexgrid forecolor
I know, too much simple question I ask. I hope not disturbing anyone, I want to end my first serious project and there are too much obstacle for an amateur programmer.
--------------------------------------------------------------------------
1- one flex with 40 row, 15 col.
2- 6 cmd_button and each linked to a different database.
2a- when I click first button, the first database will load into the flex. second button, second database ....
--------------------------------------------------------------------------
3- dbl click event on the flex will change the fore color of the 1st col of the row.
4- problem: in first scene, say, I double clicked the 4th row, ok, it changes the forecolor of the 1st col of the 4th row to blue, then, when I passed the second scene (second button) but the 4th row forecolor still remains blue.
5- I tried to solve this using a loop on each clicking of the buttons: (because I don't know any easy way)
Code:
.col=1
for i=1 to .rows-1
cellsforecolor=qbcolor(0)
next
but It slows the loading down very much.
in this condition, for not slowing what should I do ?
Have a nice day...
-
Apr 9th, 2007, 02:58 AM
#2
Re: flexgrid forecolor
Add this Sub to your Form, call it inside your CommandButton's Click event:
Code:
Private Sub ResetSelection()
With MSFlexGrid1 'Add your Flex name instead of this here
.Redraw = False
'This will ensure that complete Selection is affected
.FillStyle = flexFillRepeat
'Make a Selection (First column)
.Row = .FixedRows
.Col = .FixedCols
.RowSel = .Rows - 1
.ColSel = .Col
'Assign Flex Backcolor
.CellBackColor = .BackColor
'Remove Selection
.Col = .FixedCols
'Back to Single Fill
.FillStyle = flexFillSingle
.Redraw = True
End With
End Sub
-
Apr 14th, 2007, 04:29 AM
#3
Thread Starter
Member
Re: flexgrid forecolor
sorry for I am late,
I just try your code and it works very well,
there is no slow down.
thank you very much.
have a nice day...
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
|