1. about its property page settings: Right-click the property
2: attributes and Methods
As this control involves many attributes and methods, I will introduce some of the most frequently used data center systems.
. Rows: the return value of the first row of the row property is 0, and so on.
. Rowsel: number of selected rows, which can be a range of multiple rows
. Mouserow: row where the mouse is located
. Cols: column attribute
. Clowidth: column width
. Textmatrix (introw, intcol): returns the content of each unit.
. Cellallignment: Alignment of cell content
. Backcolorsel: select the cell background color.
. Remouveitem: Remove a line of content
3: Events
Mousedown and mouseup: The corresponding operation when the mouse is pressed or popped up
Clear: clears content, which is generally used to prevent repeated loading of required content
4: The above are some of the basic content we have encountered.
Private Sub flexgriduserinfo_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single) 'With flexgriduserinfo when you press the mouse. row =. mouseRow 'select the row with the cursor currentrow =. row 'current Row number. col = 0' select the 0th column As the standard End With End Sub 'mouseup event, and select a record Private Sub flexgriduserinfo_MouseUp (Button As Integer, Shift As Integer, x As Single, y As Single) With flexgriduserinfo If currentrow> 0 Then 'If a selected row exists. rowSel = currentrow '. rowsel action the current row is the selected row. colSel =. cols-1' always selects only one line of End If End With End Sub
Private Sub branch delete_click () Dim mrc As ADODB. recordset Dim txtSQL As String Dim msgText As String will delete the deleted user from the Registry txtSQL = "select * from user_info where user_ID = '" & flexgriduserinfo. textMatrix (flexgriduserinfo. row, 0) & "'" Set mrc = ExecuteSQL (txtSQL, msgText) If Not mrc. EOF Then mrc. delete mrc. update End If With flexgriduserinfo If. rowSel = 1 then' if you select the title line, note that I have placed the title line in the second line. rowsel = 1 MsgBox "please Select the row to be deleted! "Exit Sub End If. RemoveItem. row' remove the MsgBox Row to be deleted." The user has been deleted successfully! "Exit Sub End With End Sub