Operations on the MSHFlexGrid Control

Source: Internet
Author: User

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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.