home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
- Begin VB.Form Form1
- Caption = "Grid Edit"
- ClientHeight = 4620
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 7110
- LinkTopic = "Form1"
- ScaleHeight = 4620
- ScaleWidth = 7110
- StartUpPosition = 3 'Windows Default
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- Height = 285
- Left = 2310
- TabIndex = 1
- Top = 45
- Width = 1230
- End
- Begin MSFlexGridLib.MSFlexGrid Grid1
- Height = 3945
- Left = 225
- TabIndex = 0
- Top = 360
- Width = 6555
- _ExtentX = 11562
- _ExtentY = 6959
- Rows = 100
- Cols = 10
- AllowUserResizing= 3
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Form_Load()
- Grid1.Row = 1
- Grid1.Col = 1
- End Sub
- Private Sub Grid1_EnterCell()
- ' Make sure the user doesn't attempt to edit the fixed cells
- If Grid1.MouseRow = 0 Or Grid1.MouseCol = 0 Then
- Text1.Visible = False
- Exit Sub
- End If
- Grid1.Row = Grid1.MouseRow
- Grid1.Col = Grid1.MouseCol
- ' clear contents of current cell
- Text1.Text = ""
- ' place Textbox over current cell
- Text1.Visible = False
- Text1.Top = Grid1.Top + Grid1.CellTop
- Text1.Left = Grid1.Left + Grid1.CellLeft
- Text1.Width = Grid1.CellWidth
- Text1.Height = Grid1.CellHeight
- ' assing cell's contents to Textbox
- Text1.Text = Grid1.Text
- ' move focus to Textbox
- Text1.Visible = True
- Text1.SetFocus
- End Sub
- Private Sub Grid1_GotFocus()
- ' Make sure the user doesn't attempt to edit the fixed cells
- If Grid1.MouseRow = 0 Or Grid1.MouseCol = 0 Then
- Text1.Visible = False
- Exit Sub
- End If
- Grid1.Row = Grid1.MouseRow
- Grid1.Col = Grid1.MouseCol
- ' clear contents of current cell
- Text1.Text = ""
- ' place Textbox over current cell
- Text1.Top = Grid1.Top + Grid1.CellTop
- Text1.Left = Grid1.Left + Grid1.CellLeft
- Text1.Width = Grid1.CellWidth
- Text1.Height = Grid1.CellHeight
- ' assing cell's contents to Textbox
- Text1.Text = Grid1.Text
- ' move focus to Textbox
- Text1.SetFocus
- End Sub
- Private Sub Grid1_LeaveCell()
- Grid1.Text = Text1.Text
- End Sub
-