Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Easy way to Edit MSFlexGrid Control. ...
Author:
Rami Reddy. S
E-mail:
Click to e-mail author
Submitted:
3/27/2001
Version:
VB5
Compatibility:
VB5, VB6
Category:
Controls
Views:
21172
Easy way to Edit MSFlexGrid Control.
Declarations:
'none
Code:
'MSFlexGrid Properties: 'Rows=2 'Fixed Rows=1 'Cols=3 '=================================================== 'write this code in MSFlexGrid Keypress Event '=================================================== Private Sub MSFlexGrid_KeyPress(KeyAscii As Integer) If KeyAscii = 8 Then If Len(Trim(MSFlexGrid.TextMatrix(MSFlexGrid.RowSel, MSFlexGrid.ColSel))) > 0 Then MSFlexGrid.TextMatrix(MSFlexGrid.RowSel, MSFlexGrid.ColSel) = Mid(MSFlexGrid.TextMatrix(MSFlexGrid.RowSel, MSFlexGrid.ColSel), 1, Len(MSFlexGrid.TextMatrix(MSFlexGrid.RowSel, MSFlexGrid.ColSel)) - 1) Exit Sub Else: Exit Sub End If ElseIf KeyAscii = 13 Then If MSFlexGrid.Col <= 2 Then SendKeys "{right}" Exit Sub ElseIf MSFlexGrid.Col = 3 Then MSFlexGrid.Rows = MSFlexGrid.Rows + 1 SendKeys "{home}" + "{down}" Exit Sub End If Else 'write your own keyascii Validations under commented lines If MSFlexGrid.Col = 0 Then 'if (your condition(s)) then 'accept only charectors 'Else ' keyascii=0 'End If ElseIf MSFlexGrid.Col = 1 Then 'if (your condition(s)) then 'accepts only numbers 'Else ' keyascii=0 'End If ElseIf MSFlexGrid.Col = 2 Then 'if (your condition(s)) then 'accept all 'Else ' keyascii=0 'End If End If End If MSFlexGrid.Text = MSFlexGrid.Text + Chr(KeyAscii) End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement