|
-
Feb 18th, 2006, 06:34 AM
#1
Thread Starter
New Member
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.

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
-
Feb 20th, 2006, 03:56 AM
#2
Thread Starter
New Member
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
-
Feb 20th, 2006, 04:00 AM
#3
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 20th, 2006, 04:04 AM
#4
Thread Starter
New Member
Re: ListView or MSFlexGrid - User Edit Cells
Cheers RobDog888
I will have a look.
Matt
-
Feb 20th, 2006, 09:41 AM
#5
Thread Starter
New Member
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
-
Feb 20th, 2006, 10:48 AM
#6
Thread Starter
New Member
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
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
|