Results 1 to 3 of 3

Thread: Entering Text In MSFLEXGRID During Runtime

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9
    Hi. I'm a fairly new programmer in VB and had a question about adding text to a msflexgrid during runtime. Heres the situation. I have a msflexgrid with 20 rows and 10 columns, and what i want to do is be able to add text to each cell during runtime by entering the cell and typing. Like I said im fairly new at vb so any information would be greatly appreciated.

    PROGMT

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196

    The Crude Beginnings of a Solution

    Hi, heres some crude code that may get you started. This will type whatever you type into the cell that s selected. However, the big prob is that if you type <Backspace> or something like that it just comes up as a non-displayable character. That is, it doesnt delete the last character as you wold expect backspace to do.

    However, i did say it was crude, so it may get you on the right track.

    I'm still looking though, you would have thought you can just enter text into a field of a flexgrid.

    Perhaps it should be called MSNotSoFlexGrid

    Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
    MSFlexGrid1.Text = MSFlexGrid1.Text & Chr(KeyAscii)
    End Sub

    [Edited by funkyd77 on 03-19-2000 at 08:49 PM]

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9

    thanx

    Well You Got Me Started. Just Needed A Little Help. I Changed A Little Around In Your Code To Get The Backspace To Work. But I Appreciate The Help, Since You Got Me Started.

    Here Is What I Did

    Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)

    If Chr(KeyAscii) = Chr(8) Then
    MSFlexGrid1.Text = Mid(MSFlexGrid1.Text, 1, Len(MSFlexGrid1.Text) - 1)
    Exit Sub
    End If
    MSFlexGrid1.Text = MSFlexGrid1.Text & Chr(KeyAscii)

    End Sub

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