isnoend2001
asked on
Add Command butons to a mshFlexgrid using vb6
Add a command button to the last column in a mshflexgrid with
the index of the row
Sub AddaRowToGrid(grd As MSHFlexGrid)
Dim LastRow As Integer
Dim LastColumn As Integer
cmdViewRtf(0).Visible = False 'hide first button in header row
With grd
.Rows = .Rows + 1 'add a row
LastRow = .Rows - 1
LastColumn = Cols - 1
'add cmdButton to last centered in row last column (cmdViewRtf) with the index of the row number
End With
End Sub
how to write this ?
the index of the row
Sub AddaRowToGrid(grd As MSHFlexGrid)
Dim LastRow As Integer
Dim LastColumn As Integer
cmdViewRtf(0).Visible = False 'hide first button in header row
With grd
.Rows = .Rows + 1 'add a row
LastRow = .Rows - 1
LastColumn = Cols - 1
'add cmdButton to last centered in row last column (cmdViewRtf) with the index of the row number
End With
End Sub
how to write this ?
Do you want a command button only on the last row? If a new row is added after that do you want the command button "moved" to the new row?
ASKER
Yes when a new record record is added the a button is added to the new row, not moved each row will have a command button with the index of the new row
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Marty, you gave what i asked for, but i don't think it will work like i planned
If a row is removed the button remains as they only seem to be in the grid
I think i will have to images that look like command buttons that are actually part of the grid using the CellPicture Property
If a row is removed the button remains as they only seem to be in the grid
I think i will have to images that look like command buttons that are actually part of the grid using the CellPicture Property
No, no. no. That can be handled. Be back soon.
ASKER
Well in any case here it is.
Project1a.zip
Project1a.zip
ASKER
Thanks, gonna have more questions soon i can see what i need to do, just get stumped on how to do it