📄 frmareaedit.frm
字号:
VERSION 5.00
Begin VB.Form frmAreaEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑地域信息"
ClientHeight = 3060
ClientLeft = 45
ClientTop = 375
ClientWidth = 4980
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3060
ScaleWidth = 4980
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Cmd_Cancel
Appearance = 0 'Flat
BackColor = &H80000013&
Caption = "取消"
Height = 375
Left = 2820
MaskColor = &H00FFFFC0&
TabIndex = 6
Top = 2280
Width = 1095
End
Begin VB.CommandButton Cmd_Ok
Appearance = 0 'Flat
Caption = "确定"
Height = 375
Left = 1020
TabIndex = 5
Top = 2280
Width = 1095
End
Begin VB.Frame Frame1
Height = 1755
Left = 480
TabIndex = 0
Top = 240
Width = 3915
Begin VB.TextBox txtArea
Height = 375
Left = 1620
TabIndex = 4
Top = 960
Width = 1875
End
Begin VB.Label Label3
Caption = "地域名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 540
TabIndex = 3
Top = 1020
Width = 1035
End
Begin VB.Label lblUpper
Caption = "上级地域"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1620
TabIndex = 2
Top = 420
Width = 1035
End
Begin VB.Label Label1
Caption = "上级地域"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 540
TabIndex = 1
Top = 420
Width = 1035
End
End
End
Attribute VB_Name = "frmAreaEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Private Sub Cmd_OK_Click()
Dim TmpId As Integer
If Trim(txtArea) = "" Then
MsgBox "请输入地域名称"
Exit Sub
End If
'将用户输入的输入赋值到MyArea对象中
With MyArea
.AreaName = Trim(txtArea)
.AreaType = CurArea.AreaType + 1
.UpperId = CurArea.AreaId
If Modify = False Then '插入
If .In_DB(Trim(txtArea), .UpperId) = True Then
MsgBox Trim(txtArea) + " 已经存在"
Exit Sub
End If
TmpId = .Insert
'生成TreeView控件中新结点的关键字
Tmp_Key = Chr(Asc("a") + .AreaType)
Tmp_Key = Tmp_Key + Trim(Str(TmpId))
frmAreaMan.TreeView1.SelectedItem.Image = 1
frmAreaMan.TreeView1.SelectedItem.ExpandedImage = 2
frmAreaMan.TreeView1.SelectedItem.SelectedImage = 3
Set TmpNode = frmAreaMan.TreeView1.Nodes.Add(frmAreaMan.TreeView1.SelectedItem.Key, _
tvwChild, Tmp_Key, .AreaName, 4, 5)
TmpNode.Selected = True
Else '修改
If CurArea.AreaName <> Trim(txtArea) Then
If .In_DB(Trim(txtArea), .UpperId) = True Then
MsgBox Trim(txtArea) + " 已经存在"
Exit Sub
End If
End If
Call .Update(CurArea.AreaId)
If CurArea.AreaName <> Trim(txtArea) Then
frmAreaMan.TreeView1.SelectedItem.Text = Trim(txtArea)
End If
CurArea.AreaName = Trim(txtArea)
End If
End With
Unload Me
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -