|
-
Sep 13th, 2005, 06:42 AM
#1
Thread Starter
Lively Member
Is MSFlexGrid editable?
hi,
i m preparing a bill which will be in MSFlexGrid. Actually i have a doubt regarding MSFlexGrid, can entries be made directly in the flexgrid, if yes the are calculations possible inside the grid by givivg an event ex: calculate. Plz guys if u have any dummy code then can u plz send me, it wud of gr8 help.
wil b eagerly waiting for ur replies
kaushik
-
Sep 13th, 2005, 06:46 AM
#2
Re: Is MSFlexGrid editable?
There is calculate event for the MSFlexGrid, but you can, programmatically, make it editable. Is this what you are after?
-
Sep 13th, 2005, 06:50 AM
#3
Thread Starter
Lively Member
Re: Is MSFlexGrid editable?
 Originally Posted by Hack
There is calculate event for the MSFlexGrid, but you can, programmatically, make it editable. Is this what you are after?
Basically wat i m after is instead of writing in textboxes which will programatically enter the data in the grid. Can i directly make entries into the grid???????
-
Sep 13th, 2005, 06:53 AM
#4
Re: Is MSFlexGrid editable?
 Originally Posted by kaushiks
Basically wat i m after is instead of writing in textboxes which will programatically enter the data in the grid. Can i directly make entries into the grid??????? 
Yes. Try this.
VB Code:
Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
With MSFlexGrid1
Select Case KeyAscii
Case 8: 'backspace
If .Text <> "" Then .Text = _
Left$(.Text, (Len(.Text) - 1))
Case 13: 'enter key
Select Case .Col
Case Is < (.Cols - 1):
SendKeys "{right}"
Case (.Cols - 1):
If (.Row + 1) = .Rows Then
.Rows = .Rows + 1
End If
SendKeys "{home}" + "{down}"
End Select
Case Else
.Text = .Text + Chr$(KeyAscii)
'write your own keyascii Validations under
'commented lines
Select Case .Col
Case 0, 1, 2:
'if (your condition(s)) then
'accept only charectors
'Else
' keyascii=0
'End If
Case Else
End Select
End Select
End With
End Sub
-
Sep 13th, 2005, 06:58 AM
#5
Thread Starter
Lively Member
Re: Is MSFlexGrid editable?
 Originally Posted by Hack
Yes. Try this.
VB Code:
Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
With MSFlexGrid1
Select Case KeyAscii
Case 8: 'backspace
If .Text <> "" Then .Text = _
Left$(.Text, (Len(.Text) - 1))
Case 13: 'enter key
Select Case .Col
Case Is < (.Cols - 1):
SendKeys "{right}"
Case (.Cols - 1):
If (.Row + 1) = .Rows Then
.Rows = .Rows + 1
End If
SendKeys "{home}" + "{down}"
End Select
Case Else
.Text = .Text + Chr$(KeyAscii)
'write your own keyascii Validations under
'commented lines
Select Case .Col
Case 0, 1, 2:
'if (your condition(s)) then
'accept only charectors
'Else
' keyascii=0
'End If
Case Else
End Select
End Select
End With
End Sub
Thanx man i think this might work
-
Sep 13th, 2005, 07:02 AM
#6
Re: Is MSFlexGrid editable?
 Originally Posted by kaushiks
Thanx man i think this might work 
I honestly don't know how long I've had that piece of code, but it has been quite a while and I've used it many, many times myself.
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
|