Results 1 to 2 of 2

Thread: flexgrid editable

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    1

    flexgrid editable

    hey guys ...
    any one know how to make flexgrid to become editable ...
    and how we could add textbox, or any component into each columns ??

    i have a plan to build application in which user could fill the data comfortable
    similar like someone fill excel worksheet

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: flexgrid editable

    Welcome to the forums.

    Try this
    vb Code:
    1. Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
    2.  
    3.     With MSFlexGrid1
    4.         Select Case KeyAscii
    5.                
    6.             Case 8: 'IF KEY IS BACKSPACE THEN
    7.                 If .Text <> "" Then .Text = _
    8.                  Left$(.Text, (Len(.Text) - 1))
    9.             Case 13: 'IF KEY IS ENTER THEN
    10.                 Select Case .Col
    11.                     Case Is < (.Cols - 1):
    12.                         SendKeys "{right}"
    13.                     Case (.Cols - 1):
    14.                         If (.Row + 1) = .Rows Then
    15.                             .Rows = .Rows + 1
    16.                         End If
    17.                         SendKeys "{home}" + "{down}"
    18.                 End Select
    19.             Case Else
    20.                 .Text = .Text + Chr$(KeyAscii)
    21.                 'write your own keyascii Validations under
    22.                        'commented lines
    23.                 Select Case .Col
    24.                     Case 0, 1, 2:
    25.                         'if (your condition(s)) then
    26.                             'accept only charectors
    27.                         'Else
    28.                         '   keyascii=0
    29.                         'End If
    30.                     Case Else:
    31.                 End Select
    32.         End Select
    33.     End With

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width