Is MSFlexGrid editable in VB 6.0?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shailja
    New Member
    • Feb 2007
    • 123

    Is MSFlexGrid editable in VB 6.0?

    Hi,

    Can anyone tell me?

    1) MSFlexGrid is editable or not?
    2) Can I enter data into FlexGrid at runtime?

    Plz. help me out as soon as possible.

    Thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Bydefault MSFlexGrid not editable .

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      You can make it editable .

      Add a MSFlexGrid control and a textbox to the form.

      Set the cols property to 20 and that of rows to 100.


      then add this sample code.

      [code=vb]

      Private Sub Form_Load()
      Dim i As Integer
      For i = mfg.FixedRows To mfg.Rows - 1
      mfg.TextArray(m fg.Cols * i) = i
      Next

      For i = mfg.FixedCols To mfg.Cols - 1
      mfg.TextArray(i ) = Chr(Asc("A") + i - 1)
      Next

      End Sub


      Private Sub mfg_EnterCell()
      Text1.Text = mfg.Text
      End Sub

      Private Sub mfg_KeyPress(Ke yAscii As Integer)
      Text1.Text = Text1.Text & Chr(KeyAscii)
      Text1.SelStart = 1
      Text1.Move mfg.CellLeft + mfg.Left, mfg.CellTop + mfg.Top, mfg.CellWidth, mfg.CellHeight
      Text1.Visible = True
      Text1.SetFocus
      End Sub

      Private Sub mfg_LeaveCell()
      If Text1.Visible = False Then
      Exit Sub
      End If
      mfg.Text = Text1.Text
      Text1.Visible = False
      Text1.Text = ""
      End Sub

      [/code]

      Comment

      Working...