📄 frmflowers.frm
字号:
VERSION 5.00
Begin VB.Form frmflower
BackColor = &H00FFFFFF&
Caption = "鲜花订购系统(鲜花信息)"
ClientHeight = 6570
ClientLeft = 60
ClientTop = 630
ClientWidth = 7935
FillColor = &H00FFFFFF&
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmflowers.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmflowers.frx":1CFA
ScaleHeight = 6570
ScaleWidth = 7935
WindowState = 2 'Maximized
Begin VB.CommandButton Command1
BackColor = &H00FFFFFF&
Caption = "最前"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 13
Top = 5520
Width = 855
End
Begin VB.CommandButton Command2
BackColor = &H00FFFFFF&
Caption = "上"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3360
TabIndex = 12
Top = 5520
Width = 735
End
Begin VB.CommandButton Command3
BackColor = &H00FFFFFF&
Caption = "下"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4080
TabIndex = 11
Top = 5520
Width = 735
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
Caption = "最后"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 10
Top = 5520
Width = 735
End
Begin VB.CommandButton Command5
BackColor = &H00FFFFFF&
Caption = "添加"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 9
Top = 5880
Width = 855
End
Begin VB.CommandButton Command6
BackColor = &H00FFFFFF&
Caption = "保存"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3360
TabIndex = 8
Top = 5880
Width = 735
End
Begin VB.CommandButton Command7
BackColor = &H00FFFFFF&
Caption = "删除"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4080
TabIndex = 7
Top = 5880
Width = 735
End
Begin VB.CommandButton Command8
BackColor = &H00FFFFFF&
Caption = "退出"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4800
TabIndex = 6
Top = 5880
Width = 735
End
Begin VB.TextBox Text3
Height = 405
Left = 2040
TabIndex = 5
Top = 3120
Width = 2655
End
Begin VB.TextBox Text2
Height = 405
Left = 2040
TabIndex = 3
Top = 1920
Width = 2655
End
Begin VB.TextBox Text1
Height = 405
Left = 2040
TabIndex = 1
Top = 840
Width = 1335
End
Begin VB.Image Image1
Height = 1815
Left = 8520
Picture = "frmflowers.frx":1493A
Stretch = -1 'True
Top = 1680
Width = 1935
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
Caption = "鲜花价格"
Height = 375
Left = 720
TabIndex = 4
Top = 3120
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "鲜花名称"
Height = 375
Left = 720
TabIndex = 2
Top = 1920
Width = 1215
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
Caption = "鲜花编号"
Height = 375
Left = 720
TabIndex = 0
Top = 840
Width = 1215
End
Begin VB.Menu do
Caption = "操作(&D)"
Begin VB.Menu add
Caption = "添加"
Shortcut = ^B
End
Begin VB.Menu save
Caption = "更改"
Shortcut = ^A
End
Begin VB.Menu delete
Caption = "删除"
Shortcut = ^D
End
Begin VB.Menu privous
Caption = "上一个"
Shortcut = ^P
End
Begin VB.Menu next
Caption = "下一个"
Shortcut = ^N
End
Begin VB.Menu exit
Caption = "退出"
Shortcut = ^E
End
End
End
Attribute VB_Name = "frmflower"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub add_Click()
Call Command5_Click
End Sub
''''''''''''''''''''''''''''''''鲜花窗体中'''''''''''''''''''''''''''''''''
'第一个
Private Sub Command1_Click()
rs2.MoveFirst
Call showflower
End Sub
'上一个
Private Sub Command2_Click()
rs2.MovePrevious
If rs2.BOF = True Then
rs2.MoveLast
End If
Call showflower
End Sub
'下一个
Private Sub Command3_Click()
rs2.MoveNext
If rs2.EOF = True Then
rs2.MoveFirst
End If
Call showflower
End Sub
'最后一个
Private Sub Command4_Click()
rs2.MoveLast
Call showflower
End Sub
'添加
Private Sub Command5_Click()
If Text1.Text = Empty Or Text2.Text = Empty Or Text3.Text = Empty Then
MsgBox "请输入鲜花的详细信息,否则无法存储!", vbInformation + vbOKOnly, "数据不完整"
Else
rs2.AddNew
rs2.Fields("flowercode").Value = Text1.Text
rs2.Fields("flowername").Value = Text2.Text
rs2.Fields("flowerprice").Value = Text3.Text
rs2.Update
MsgBox "添加成功!", vbInformation + vbOKOnly, "数据添加成功"
End If
End Sub
'修改
Private Sub Command6_Click()
rs2.Fields("flowercode").Value = Text1.Text
rs2.Fields("flowername").Value = Text2.Text
rs2.Fields("flowerprice").Value = Text3.Text
rs2.Update
MsgBox "数据修改成功", vbInformation + vbOKOnly, "修改数据"
End Sub
'删除
Private Sub Command7_Click()
On Error GoTo conerr
If MsgBox("数据删除后将无法恢复,你确定要删除吗?", vbQuestion + vbYesNo, "信息提示") = vbYes Then
rs2.delete adAffectCurrent
rs2.UpdateBatch adAffectAllChapters
rs2.MoveFirst
Call showflower
MsgBox "信息已删除!", vbInformation + vbOKOnly, "删除"
End If
Exit Sub
conerr:
MsgBox "错误编号:" & Err.Number & _
"错误描述:" & Err.Description, vbInformation + vbOKOnly, "错误"
End Sub
'退出
Private Sub Command8_Click()
Unload Me
End Sub
Private Sub delete_Click()
Call Command7_Click
End Sub
Private Sub exit_Click()
Unload Me
End Sub
'查询鲜花表中的所有数据并显示第一组数据
Private Sub Form_Load()
Dim strsql2 As String
strsql2 = "select * from flower"
Set rs2 = Nothing
Call rs2.Open(strsql2, g_dbcon, adOpenDynamic, adLockOptimistic, -1)
rs2.MoveFirst
Call showflower
End Sub
Private Sub next_Click()
Call Command3_Click
End Sub
Private Sub privous_Click()
Call Command2_Click
End Sub
Private Sub save_Click()
Call Command6_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -