by Syed Ghazanfar Ali (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 7th August 2001
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
Just with a few lines of code you can make MSFlex Grid control like Spreadsheeet in Excel. Whatever you enter in the text box will be entered
' Karachi, Pakistan
' Send comments to E-Mail : [email protected]
' This program may be used to give an Excel like Effect to your application
' You can even add another Text Box At the Top and Give a different code
' Just remove the Text Box lookalike code
' To get same visual display as Excel
' For this open a new Project
' And in the form
' Place A MSFlexGridControl and a Text Box
' Then enter the following lines of code as it is
Private Sub Grid1_EnterCell()
' To make sure that the user doesn't attempt to edit fixed cells
If Grid1.MouseRow = 0 Or Grid1.MouseCol = 0 Then
Text1.Visible = False
Exit Sub
End If
' Clear contents of current cell
Text1.Text = ""
' Place Text Box over current Cell
' And make Text Box look alike the Cell
Text1.Visible = False
Text1.Top = Grid1.Top + Grid1.CellTop
Text1.Left = Grid1.Left + Grid1.CellLeft
Text1.Width = Grid1.CellWidth
Text1.Height = Grid1.CellHeight
' Assign Cell contents to the Text Box
Text1.Text = Grid1.Text
' Move focus to the Text box
Text1.Visible = True
Text1.SetFocus
End Sub
Private Sub Grid1_LeaveCell()
' Assign the Text box contents to the Cell
Grid1.Text = Text1.Text
End Sub
No comments have been posted about Just with a few lines of code you can make MSFlex Grid control like Spreadsheeet in Excel. Whatever. Why not be the first to post a comment about Just with a few lines of code you can make MSFlex Grid control like Spreadsheeet in Excel. Whatever.