-
Aug 3rd, 2024, 04:12 AM
#1
Thread Starter
PowerPoster
clear MSFLEGRID
The code clear all in msflexgrid from column o to the and .
Now i need to clear all from column 1...
How to change code?
Code:
Private Sub ClearFlex(pFlex As MSFlexGrid)
With pFlex
.Redraw = False
.Row = .FixedRows
.Col = .FixedCols
.RowSel = .Rows - 1
.ColSel = .Cols - 1
.FillStyle = flexFillRepeat
Set .CellPicture = Nothing
.CellForeColor = False
.Text = vbNullString
.FillStyle = flexFillSingle
.Col = 0
.Redraw = True
End With
End Sub
-
Aug 3rd, 2024, 07:34 AM
#2
Re: clear MSFLEGRID
This is all you need to clear the entire MSFlexgrid:
To clear column 1 (the second column), this is all you need:
Code:
Dim i As Integer
For i = 0 To MSFlexGrid1.Cols - 1
MSFlexGrid1.TextMatrix(i, 1) = ""
Next i
Sam I am (as well as Confused at times).
-
Aug 3rd, 2024, 08:43 AM
#3
Re: clear MSFLEGRID
Try with:
Originally Posted by luca90
Code:
Private Sub ClearFlex(pFlex As MSFlexGrid)
With pFlex
.Redraw = False
.Row = .FixedRows + 1
.Col = .FixedCols
.RowSel = .Rows - 1
.ColSel = .Cols - 1
.FillStyle = flexFillRepeat
Set .CellPicture = Nothing
.CellForeColor = False
.Text = vbNullString
.FillStyle = flexFillSingle
.Col = 0
.Redraw = True
End With
End Sub
-
Aug 3rd, 2024, 09:32 AM
#4
Thread Starter
PowerPoster
Re: clear MSFLEGRID
Originally Posted by Eduardo-
Try with:
Tks bro!
-
Aug 3rd, 2024, 12:14 PM
#5
Sam I am (as well as Confused at times).
-
Aug 3rd, 2024, 12:33 PM
#6
Thread Starter
PowerPoster
Re: clear MSFLEGRID
Originally Posted by SamOscarBrown
Why all that code?
Not mine code...
Have a new TIPS!
-
Aug 3rd, 2024, 05:19 PM
#7
Re: clear MSFLEGRID
Just sayin'----not necessary..... .Clear does it all for you...one line (to 'empty' the entire grid).
Then just four lines to do the second thing you asked. So simple.
Sam I am (as well as Confused at times).
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
|