Clear Method (MSHFlexGrid) Example

The following code places "Flex" into the current cell whenever the user clicks on a cell. When the user double-clicks, it clears the MSHFlexGrid. To run the program, press f5.

Note   If you are using the MSFlexGrid, substitute "MSHFlexGrid1" with "MSFlexGrid1."

Private Sub Form1_Load ()
   MSHFlexGrid1.Rows =8
   MSHFlexGrid1.Cols =5
End Sub

Private Sub MSHFlexGrid1_Click ()
   ' Put text in current cell.
   MSHFlexGrid1.Text ="Flex"
End Sub

Private Sub MSHFlexGrid1.DblClick ()
   MSFlexGrid1.Clear
End Sub