📄 frmteachermessage.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Frmteachermessage
Caption = "用户信息管理"
ClientHeight = 3585
ClientLeft = 60
ClientTop = 465
ClientWidth = 5655
LinkTopic = "Form1"
ScaleHeight = 3585
ScaleWidth = 5655
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 375
Index = 1
Left = 3000
TabIndex = 10
Top = 2160
Width = 1935
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 4200
Top = 240
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = $"Frmteachermessage.frx":0000
OLEDBString = $"Frmteachermessage.frx":008C
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from user_message"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataList DataList1
Bindings = "Frmteachermessage.frx":0118
DataField = "use_name"
DataSource = "Adodc1"
Height = 1950
Left = 360
TabIndex = 8
Top = 840
Width = 1215
_ExtentX = 2143
_ExtentY = 3440
_Version = 393216
ListField = "use_name"
End
Begin VB.CommandButton Command1
BackColor = &H00FFC0C0&
Caption = "添加用户"
Height = 495
Left = 240
MouseIcon = "Frmteachermessage.frx":012D
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 7
Top = 3000
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton Command2
BackColor = &H00FFC0C0&
Caption = "修改用户"
Height = 495
Left = 240
MouseIcon = "Frmteachermessage.frx":0437
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 6
Top = 3000
Visible = 0 'False
Width = 1095
End
Begin VB.CommandButton Command3
BackColor = &H00FFC0C0&
Caption = "删除用户"
Height = 495
Left = 240
MouseIcon = "Frmteachermessage.frx":0741
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 5
Top = 3000
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton Command4
BackColor = &H00FFC0C0&
Caption = "返 回"
Height = 495
Left = 4200
MouseIcon = "Frmteachermessage.frx":0A4B
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 4
Top = 3000
Width = 1215
End
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Caption = "用户信息"
Height = 1815
Left = 2040
TabIndex = 0
Top = 960
Width = 3255
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 960
TabIndex = 9
Top = 600
Width = 1935
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用户名:"
Height = 255
Left = 240
TabIndex = 2
Top = 600
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 码:"
Height = 255
Left = 360
TabIndex = 1
Top = 1200
Width = 735
End
End
Begin VB.Frame Frame1
Caption = "用户名列表"
Height = 2295
Left = 240
TabIndex = 11
Top = 600
Width = 1455
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "用 户 信 息"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 3
Top = 240
Width = 1815
End
End
Attribute VB_Name = "Frmteachermessage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
DataList1.Refresh
Adodc1.Refresh
DataList1.ReFill
Open_user_message
cnn.AddNew
cnn.Fields(0).Value = Text1(0).Text
cnn.Fields(1).Value = Text1(1).Text
cnn.Update
Adodc1.Refresh
DataList1.Refresh
DataList1.ReFill
MsgBox "添加成功!"
End Sub
Private Sub Command3_Click()
Open_user_message
Do While cnn.EOF = False
If cnn.EOF = True Then
Exit Do
End If
If DataList1.Text = cnn.Fields(0) Then
cnn.Delete
Exit Do
End If
cnn.MoveNext
Loop
MsgBox "删除成功!"
DataList1.Refresh
Adodc1.Refresh
DataList1.ReFill
End Sub
Private Sub Command2_Click()
cnn.Fields(0).Value = Text1(0).Text
cnn.Fields(1).Value = Text1(1).Text
cnn.Update
MsgBox "修改成功!"
DataList1.Refresh
Adodc1.Refresh
DataList1.ReFill
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub DataList1_Click()
Text1(0).Text = DataList1.Text
cnn.MoveFirst
Do While cnn.EOF = False
If cnn.EOF = True Then
Exit Sub
End If
If DataList1.Text = cnn.Fields(0).Value Then
Text1(1).Text = cnn.Fields(1).Value
Exit Sub
Else
End If
cnn.MoveNext
Loop
End Sub
Private Sub Form_Load()
Open_user_message
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -