📄 frmstyleedit.frm
字号:
VERSION 5.00
Begin VB.Form FrmStyleEdit
BorderStyle = 1 'Fixed Single
Caption = "户型信息编辑"
ClientHeight = 2760
ClientLeft = 45
ClientTop = 330
ClientWidth = 6345
Icon = "FrmStyleEdit.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2760
ScaleWidth = 6345
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 1815
Left = 240
TabIndex = 6
Top = 120
Width = 5895
Begin VB.TextBox txtDescribe
Height = 735
Left = 1200
MaxLength = 100
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 960
Width = 4455
End
Begin VB.TextBox txtName
Height = 270
Left = 1200
MaxLength = 100
TabIndex = 0
Top = 210
Width = 4455
End
Begin VB.TextBox txtArea1
Height = 270
Left = 1200
MaxLength = 200
TabIndex = 1
Top = 570
Width = 975
End
Begin VB.TextBox txtArea2
Height = 270
Left = 4080
MaxLength = 20
TabIndex = 2
Top = 570
Width = 975
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "平方米"
Height = 180
Left = 5160
TabIndex = 12
Top = 615
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "平方米"
Height = 180
Left = 2280
TabIndex = 11
Top = 615
Width = 540
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备注信息"
Height = 180
Left = 240
TabIndex = 10
Top = 990
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "房型名称"
Height = 180
Left = 240
TabIndex = 9
Top = 240
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "建筑面积"
Height = 180
Left = 240
TabIndex = 8
Top = 615
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "使用面积"
Height = 180
Left = 3120
TabIndex = 7
Top = 615
Width = 720
End
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Height = 400
Left = 1517
MouseIcon = "FrmStyleEdit.frx":0CCA
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 4
Top = 2160
Width = 1300
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 3677
MouseIcon = "FrmStyleEdit.frx":0FD4
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 5
Top = 2160
Width = 1300
End
End
Attribute VB_Name = "FrmStyleEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriId As Long
Public OriName As String
Private Sub Cmd_OK_Click()
'检查数据的有效性
If Trim(txtName) = "" Then
MsgBox "请输入户型名称"
txtName.SetFocus
Exit Sub
End If
'把用户录入的数据赋值到MyStyle对象中
With MyStyle
.StyleName = MakeStr(txtName)
.Area1 = Val(txtArea1)
.Area2 = Val(txtArea2)
.Memo = MakeStr(txtDescribe)
'判断户型名称是否存在
If Modify = False Or OriName <> Trim(txtName) Then
If .In_DB(MakeStr(txtName)) = True Then
MsgBox "户型名称已经存在,请重新输入"
txtName.SetFocus
txtName.SelStart = 0
txtName.SelLength = Len(txtName)
Exit Sub
End If
End If
'根据变量Modify的值决定是插入新数据还是修改已有的数据
If Modify = False Then
.Insert
Else
.Update (OriId)
End If
End With
'关闭窗体
Unload Me
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub txtArea1_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
Private Sub txtArea2_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
Private Sub txtDescribe_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtName_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -