📄 frmset.frm
字号:
VERSION 5.00
Begin VB.Form FrmSET
BorderStyle = 1 'Fixed Single
Caption = "全局设置客房状态"
ClientHeight = 4155
ClientLeft = 45
ClientTop = 360
ClientWidth = 4980
Icon = "FrmSET.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4155
ScaleWidth = 4980
Begin VB.Frame Frame3
Caption = "目标地址"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3615
Left = 360
TabIndex = 1
Top = 240
Width = 1815
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 3255
Left = 120
ScaleHeight = 3255
ScaleWidth = 1575
TabIndex = 2
Top = 240
Width = 1575
Begin VB.TextBox Text1
Height = 270
Left = 120
TabIndex = 5
Text = "7"
Top = 2520
Width = 1095
End
Begin VB.OptionButton Option10
Caption = "指定楼层"
Height = 375
Left = 120
TabIndex = 4
Top = 960
Value = -1 'True
Width = 1095
End
Begin VB.OptionButton Option9
Caption = "全部客房"
Height = 375
Left = 120
TabIndex = 3
Top = 240
Width = 1095
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "楼层号:7~22"
Height = 255
Left = 120
TabIndex = 6
Top = 2160
Width = 1215
End
End
End
Begin VB.Frame Frame1
Caption = "设置客房当前状态"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3615
Left = 2520
TabIndex = 0
Top = 240
Width = 2175
Begin VB.PictureBox Picture2
BackColor = &H8000000E&
BorderStyle = 0 'None
Height = 3255
Left = 120
ScaleHeight = 3255
ScaleWidth = 1935
TabIndex = 7
Top = 240
Width = 1935
Begin VB.OptionButton Option1
Caption = "停租"
Height = 375
Left = 240
TabIndex = 12
Top = 120
Width = 1215
End
Begin VB.OptionButton Option2
Caption = "待租"
Height = 375
Left = 240
TabIndex = 11
Top = 600
Width = 975
End
Begin VB.OptionButton Option3
Caption = "出租"
Height = 375
Left = 240
TabIndex = 10
Top = 1200
Value = -1 'True
Width = 855
End
Begin VB.OptionButton Option4
Caption = "入住"
Height = 375
Left = 240
TabIndex = 9
Top = 1800
Width = 855
End
Begin VB.CommandButton Command7
Caption = "下载状态"
Height = 375
Left = 480
TabIndex = 8
Top = 2520
Width = 1215
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 4300
Left = 1320
Top = 1440
End
End
End
End
Attribute VB_Name = "FrmSET"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'***************************************************************************
http://www.codesky.net 源码天空
'***************************************************************************
Dim 楼层 As Byte
Private Sub Form_Load()
'-----------------------------
Me.BackColor = RGB(228, 228, 255)
Frame1.BackColor = RGB(228, 228, 255)
Frame3.BackColor = RGB(228, 228, 255)
Picture1.BackColor = RGB(228, 228, 255)
Picture2.BackColor = RGB(228, 228, 255)
Option1.BackColor = RGB(228, 228, 255)
Option2.BackColor = RGB(228, 228, 255)
Option3.BackColor = RGB(228, 228, 255)
Option4.BackColor = RGB(228, 228, 255)
Option9.BackColor = RGB(228, 228, 255)
Option10.BackColor = RGB(228, 228, 255)
'-------------------------------
Me.Height = 4560
Me.Width = 5100
Move Screen.Width / 2 - Width / 2, Screen.Height / 2 - Height / 2 - 1200
End Sub
Private Sub Command7_Click()
If Option1.Value Then Call TX_房态(0) '空房
If Option2.Value Then Call TX_房态(1) '待租
If Option3.Value Then Call TX_房态(2) '出租
If Option4.Value Then Call TX_房态(3) '入住
End Sub
Sub TX_房态(LISK As Byte)
ReDim TxData(6) '重定义维数
TxData(0) = &HFF
TxData(1) = 5 'len
TxData(2) = 0 'Temp_Rcu_Adr
TxData(3) = &H22 'com
TxData(4) = LISK 'lisk
TxData(5) = 0
TxData(6) = 0
'-----------------------------------------------------
If Option10.Value Then
Dim h As Byte
h = Val(Text1.Text)
If h >= 7 And h <= 12 Then
h = h - 7
Call 发送给指定层(h)
ElseIf h >= 14 And h <= 22 Then
h = h - 8
Call 发送给指定层(h)
Else
MsgBox "楼层号错误"
End If
End If
'---------------------------------------------------
If Option9.Value Then
楼层 = 0
Call 发送给指定层(楼层)
Timer1.Enabled = True
End If
End Sub
Private Sub 发送给指定层(ByVal h As Byte)
'h=T_Hub_Adr = 0 To 14
If FrmWIK.Winsock1(h).State = sckConnected Then
FrmWIK.Winsock1(h).SendData TxData() '如已连拨则发送
End If
End Sub
Private Sub Timer1_Timer()
楼层 = 楼层 + 1
Call 发送给指定层(楼层)
If 楼层 = 14 Then Timer1.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -