ListView or MSFlexGrid - User Edit Cells
I have a list view (But I now understand that I may need to use a MSFlexGrid) that is populated with data from a database and I am trying to allow a column to be left blank for user input. Please see the following screen shot.
http://currington.net/ddn/vb6_column.gif
The columns that are populated from the db must remain unchanged.
I am sure there is a simple solution but this one is realy fighting me.
Thank you in advance.
Matt
Re: ListView or MSFlexGrid - User Edit Cells
I am still stuck on this one so if anybody can help I would be very greatful.
Matt
Re: ListView or MSFlexGrid - User Edit Cells
Here is an example of writting directly to a FlexGrid - http://www.vbforums.com/showthread.php?t=231160
You can get more complex by "floating" a textbox sized the same as the cell but its tricky. I have some code to do it if you try a search by my username and probably listview.
Re: ListView or MSFlexGrid - User Edit Cells
Cheers RobDog888
I will have a look.
Matt
Re: ListView or MSFlexGrid - User Edit Cells
RobDog888 that works a treat, thank you.
I do have one question though.
I want to populate all the columns (Apart from one) from a DB and I set it so only one column (Left blank) can be edited/selected be the user.
I am sure I know how to populate the columns from the DB but I am not sure how to set only one column to user input.
Thank you in advance.
Matt
Re: ListView or MSFlexGrid - User Edit Cells
Sorted.
I took the easy option
VB Code:
Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
If MSFlexGrid1.Col = 1 Then
With MSFlexGrid1
Select Case KeyAscii
Case 8
If Not .Text = "" Then
.Text = Left(.Text, Len(.Text) - 1)
End If
Case 9 ' Tab
If .Col + 1 = .Cols Then
.Col = 0
If .Row + 1 = .Rows Then
.Row = 0
Else
.Row = .Row + 1
End If
Else
.Col = .Col + 1
End If
Case Else
.Text = .Text & Chr(KeyAscii)
End Select
End With
End If
End Sub
Thanks again Rob