|
-
Oct 24th, 2025, 05:37 AM
#11
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Mustaphi
Hello again Krool
I need to allow only numeric values and the decimal point in column 2 but this code doesn't seem to work
Code:
Private Sub VBFlexGrid1_KeyPress(KeyChar As Integer)
With VBFlexGrid1
If .Col = 2 Then
Select Case KeyAscii
Case vbKey0 To vbKey9
Case Asc(".")
Case Else
KeyAscii = 0
End Select
End If
End With
End Sub
thank you
With so little context it is difficult to help.
I assume you are referring to user editing a cell ? If yes, then KeyPress is the wrong event. Probably EditKeyPress event is what you are looking for.
Also to note is that KeyAscii got renamed to KeyChar in my events.
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
|