📄 renamegroupform.frm
字号:
VERSION 5.00
Begin VB.Form RenameGroupForm
BorderStyle = 1 'Fixed Single
Caption = "更改组名"
ClientHeight = 1650
ClientLeft = 45
ClientTop = 330
ClientWidth = 2820
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1650
ScaleWidth = 2820
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdCancle
Caption = "放弃"
Height = 375
Left = 1571
TabIndex = 3
Top = 1080
Width = 855
End
Begin VB.CommandButton cmdOk
Caption = "确定"
Height = 375
Left = 394
TabIndex = 2
Top = 1080
Width = 855
End
Begin VB.TextBox txtGroupName
Height = 270
Left = 120
TabIndex = 1
Top = 480
Width = 2535
End
Begin VB.Label lblErrorInfo
ForeColor = &H000000FF&
Height = 240
Left = 120
TabIndex = 4
Top = 840
Width = 2535
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请在下框中修改组名"
Height = 180
Left = 120
TabIndex = 0
Top = 120
Width = 1620
End
End
Attribute VB_Name = "RenameGroupForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'***********************************************************************
'* 文件名: RenameGroupForm.frm
'* 说 明: 追加新组窗口
'* 版 本: 2005.12.15 颜志军 初版
'***********************************************************************
Option Explicit
'***********************************************************************
'模块级变量定义
Public g_groupId As Long '组ID
Public g_updateFlag As Boolean '更新状态
'***********************************************************************
'* 过程名:cmdCancle_Click
'* 功 能:“放弃”按钮单击事件响应
'* 参 数:
'* 版 本:2005.12.15 颜志军 初版
'***********************************************************************
Private Sub cmdCancle_Click()
Unload Me
End Sub
'***********************************************************************
'* 过程名:cmdOk_Click
'* 功 能:“确定”按钮单击事件响应
'* 参 数:
'* 版 本:2005.12.15 颜志军 初版
'***********************************************************************
Private Sub cmdOk_Click()
'变量定义
Dim newGroupName As String '新组名
Dim newGroupInfo As GroupInfo '新组信息
Dim existFlag As Boolean '组名存在标志
'取得用户输入组名
newGroupName = txtGroupName.Text
'删除首尾空格
newGroupName = Trim(newGroupName)
'新组名合法性检查
If IsEmpty(newGroupName) Or newGroupName = "" Then
lblErrorInfo.Caption = "组名不能为空!"
Exit Sub
End If
'检查组名是否已经存在
existFlag = False
If IsExistGroup(newGroupName, existFlag) Then
If existFlag Then
lblErrorInfo.Caption = "组名已经存在!"
Exit Sub
End If
End If
'更新新组名到数据库
newGroupInfo.groupId = g_groupId
newGroupInfo.groupName = newGroupName
If UpdateGroupInfo(newGroupInfo) Then
g_updateFlag = True
Me.Hide
Else
lblErrorInfo.Caption = "更新组名失败!"
End If
End Sub
'***********************************************************************
'* 过程名:Form_Load
'* 功 能:窗体LOAD事件响应
'* 参 数:
'* 版 本:2005.12.15 颜志军 初版
'***********************************************************************
Private Sub Form_Load()
'变量定义
Dim curGroupInfo As GroupInfo '组信息
'取得组名
If GetGroupInfo(g_groupId, curGroupInfo) Then
txtGroupName.Text = curGroupInfo.groupName
End If
'初始更新状态
g_updateFlag = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -