thieumao

Thêm xóa table (MSFlexGrid) trong VB6

Oct 17th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.79 KB | None | 0 0
  1. ' Học thêm tại http://my.opera.com/levanduyet/blog/show.dml/2149802
  2.  
  3. Dim id As Integer
  4. Private Sub cmdLogin_Click()
  5.     id = id + 1
  6.     With testMSFlexGrid3
  7.         .Rows = .Rows + 1
  8.         .TextMatrix(id, 0) = id
  9.         .TextMatrix(id, 1) = tbUsername.Text
  10.         .TextMatrix(id, 2) = tbPassword.Text
  11.     End With
  12.     tbUsername.Text = ""
  13.     tbPassword.Text = ""
  14. End Sub
  15.  
  16. Private Sub cmdRemove_Click()
  17.     If id > 0 Then
  18.         id = id - 1
  19.         With testMSFlexGrid3
  20.             .Rows = .Rows - 1
  21.         End With
  22.     End If
  23. End Sub
  24.  
  25. Private Sub Form_Load()
  26.    id = 0
  27.    With testMSFlexGrid3
  28.         .Rows = 1
  29.         .Cols = 3
  30.         .TextMatrix(0, 0) = "ID"
  31.         .TextMatrix(0, 1) = "Username"
  32.         .TextMatrix(0, 2) = "Password"
  33.    End With
  34. End Sub
Advertisement
Add Comment
Please, Sign In to add comment