⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form2.frm

📁 用VB控制STC89C52 12路开关输出16路开关输入 软件开关各种电器,自动化应用的宝贝
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   Caption         =   "板一"
   ClientHeight    =   8670
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   11250
   LinkTopic       =   "Form2"
   Picture         =   "Form2.frx":0000
   ScaleHeight     =   8670
   ScaleWidth      =   11250
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text16 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   8400
      TabIndex        =   29
      Text            =   "输入十六"
      Top             =   6720
      Width           =   1215
   End
   Begin VB.TextBox Text15 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   6120
      TabIndex        =   28
      Text            =   "输入十五"
      Top             =   6720
      Width           =   1215
   End
   Begin VB.Timer Timer1 
      Left            =   9960
      Top             =   3480
   End
   Begin VB.TextBox Text14 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   3720
      TabIndex        =   27
      Text            =   "输入十四"
      Top             =   6720
      Width           =   1215
   End
   Begin VB.TextBox Text13 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   1560
      TabIndex        =   26
      Text            =   "输入十三"
      Top             =   6720
      Width           =   1215
   End
   Begin VB.TextBox Text12 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   9480
      TabIndex        =   25
      Text            =   "输入十二"
      Top             =   5760
      Width           =   1215
   End
   Begin VB.TextBox Text11 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   7680
      TabIndex        =   24
      Text            =   "输入十一"
      Top             =   5760
      Width           =   1215
   End
   Begin VB.TextBox Text10 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   5880
      TabIndex        =   23
      Text            =   "输入十"
      Top             =   5760
      Width           =   1215
   End
   Begin VB.TextBox Text9 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   4080
      TabIndex        =   22
      Text            =   "输入九"
      Top             =   5760
      Width           =   1215
   End
   Begin VB.TextBox Text8 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   2280
      TabIndex        =   21
      Text            =   "输入八"
      Top             =   5760
      Width           =   1215
   End
   Begin VB.TextBox Text7 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   480
      TabIndex        =   20
      Text            =   "输入七"
      Top             =   5760
      Width           =   1215
   End
   Begin VB.TextBox Text6 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   9480
      TabIndex        =   19
      Text            =   "输入六"
      Top             =   4800
      Width           =   1215
   End
   Begin VB.TextBox Text5 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   7680
      TabIndex        =   18
      Text            =   "输入五"
      Top             =   4800
      Width           =   1215
   End
   Begin VB.TextBox Text4 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   5880
      TabIndex        =   17
      Text            =   "输入四"
      Top             =   4800
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   4080
      TabIndex        =   16
      Text            =   "输入三"
      Top             =   4800
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   2280
      TabIndex        =   15
      Text            =   "输入二"
      Top             =   4800
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Alignment       =   2  'Center
      Height          =   495
      Left            =   480
      TabIndex        =   14
      Text            =   "输入一"
      Top             =   4800
      Width           =   1215
   End
   Begin VB.CommandButton Command14 
      Caption         =   "二组总控制"
      Height          =   495
      Left            =   7320
      Style           =   1  'Graphical
      TabIndex        =   13
      Top             =   3120
      Width           =   1575
   End
   Begin VB.CommandButton Command13 
      Caption         =   "一组总控制"
      Height          =   495
      Left            =   2400
      Style           =   1  'Graphical
      TabIndex        =   12
      Top             =   3120
      Width           =   1695
   End
   Begin VB.CommandButton Command12 
      Caption         =   "输出十二"
      Height          =   495
      Left            =   9480
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CommandButton Command11 
      Caption         =   "输出十一"
      Height          =   495
      Left            =   7680
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CommandButton Command10 
      Caption         =   "输出十"
      Height          =   495
      Left            =   5880
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CommandButton Command9 
      Caption         =   "输出九"
      Height          =   495
      Left            =   4080
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CommandButton Command8 
      Caption         =   "输出八"
      Height          =   495
      Left            =   2400
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CommandButton Command7 
      Caption         =   "输出七"
      Height          =   495
      Left            =   480
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   2040
      Width           =   1215
   End
   Begin VB.CommandButton Command6 
      Caption         =   "输出六"
      Height          =   495
      Left            =   9480
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   1080
      Width           =   1215
   End
   Begin VB.CommandButton Command5 
      Caption         =   "输出五"
      Height          =   495
      Left            =   7680
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   1080
      Width           =   1215
   End
   Begin VB.CommandButton Command4 
      Caption         =   "输出四"
      Height          =   495
      Left            =   5880
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   1080
      Width           =   1215
   End
   Begin VB.CommandButton Command3 
      Caption         =   "输出三"
      Height          =   495
      Left            =   4080
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1080
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "输出二"
      Height          =   495
      Left            =   2400
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   1080
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "输出一"
      Height          =   495
      Left            =   480
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   1080
      Width           =   1215
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Form1.A1_flag = True
End Sub

Private Sub Command10_Click()
    Form1.A10_flag = True
End Sub

Private Sub Command11_Click()
    Form1.A11_flag = True
End Sub

Private Sub Command12_Click()
    Form1.A12_flag = True
End Sub

Private Sub Command13_Click()
    Form1.A13_flag = True
End Sub

Private Sub Command14_Click()
    Form1.A14_flag = True
End Sub

Private Sub Command2_Click()
    Form1.A2_flag = True
End Sub

Private Sub Command3_Click()
    Form1.A3_flag = True
End Sub

Private Sub Command4_Click()
    Form1.A4_flag = True
End Sub

Private Sub Command5_Click()
    Form1.A5_flag = True
End Sub

Private Sub Command6_Click()
   Form1.A6_flag = True
End Sub

Private Sub Command7_Click()
   Form1.A7_flag = True
End Sub

Private Sub Command8_Click()
   Form1.A8_flag = True
End Sub

Private Sub Command9_Click()
   Form1.A9_flag = True
End Sub

Private Sub Form_Load()
   Timer1.Interval = 100
   Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
    Timer1.Enabled = False
    If (Form1.in_A1 = True) Then
        Text1.BackColor = &HFF&
    Else
        Text1.BackColor = &HFF00&
    End If
    
    If (Form1.in_A2 = True) Then
        Text2.BackColor = &HFF&
    Else
        Text2.BackColor = &HFF00&
    End If
    
    If (Form1.in_A3 = True) Then
        Text3.BackColor = &HFF&
    Else
        Text3.BackColor = &HFF00&
    End If
    
    If (Form1.in_A4 = True) Then
        Text4.BackColor = &HFF&
    Else
        Text4.BackColor = &HFF00&
    End If
    
    If (Form1.in_A5 = True) Then
        Text5.BackColor = &HFF&
    Else
        Text5.BackColor = &HFF00&
    End If
    
    If (Form1.in_A6 = True) Then
        Text6.BackColor = &HFF&
    Else
        Text6.BackColor = &HFF00&
    End If
    
    If (Form1.in_A7 = True) Then
        Text7.BackColor = &HFF&
    Else
        Text7.BackColor = &HFF00&
    End If
    
    If (Form1.in_A8 = True) Then
        Text8.BackColor = &HFF&
    Else
        Text8.BackColor = &HFF00&
    End If
    
    If (Form1.in_A9 = True) Then
        Text9.BackColor = &HFF&
    Else
        Text9.BackColor = &HFF00&
    End If
    
    If (Form1.in_A10 = True) Then
        Text10.BackColor = &HFF&
    Else
        Text10.BackColor = &HFF00&
    End If
    
    If (Form1.in_A11 = True) Then
        Text11.BackColor = &HFF&
    Else
        Text11.BackColor = &HFF00&
    End If
    
    If (Form1.in_A12 = True) Then
        Text12.BackColor = &HFF&
    Else
        Text12.BackColor = &HFF00&
    End If
    
    If (Form1.in_A13 = True) Then
        Text13.BackColor = &HFF&
    Else
        Text13.BackColor = &HFF00&
    End If
    
    If (Form1.in_A14 = True) Then
        Text14.BackColor = &HFF&
    Else
        Text14.BackColor = &HFF00&
    End If
    
    If (Form1.in_A15 = True) Then
        Text15.BackColor = &HFF&
    Else
        Text15.BackColor = &HFF00&
    End If
    
    If (Form1.in_A16 = True) Then
        Text16.BackColor = &HFF&
    Else
        Text16.BackColor = &HFF00&
    End If
    
    If Form1.out_A1 = True Then
        Command1.BackColor = &HFF&
    Else
        Command1.BackColor = &HFF00&
    End If
    
    If Form1.out_A2 = True Then
        Command2.BackColor = &HFF&
    Else
        Command2.BackColor = &HFF00&
    End If
    
    If Form1.out_A3 = True Then
        Command3.BackColor = &HFF&
    Else
        Command3.BackColor = &HFF00&
    End If
    
    If Form1.out_A4 = True Then
        Command4.BackColor = &HFF&
    Else
        Command4.BackColor = &HFF00&
    End If
    
    If Form1.out_A5 = True Then
        Command5.BackColor = &HFF&
    Else
        Command5.BackColor = &HFF00&
    End If
    
    If Form1.out_A6 = True Then
        Command6.BackColor = &HFF&
    Else
        Command6.BackColor = &HFF00&
    End If
    
    If Form1.out_A7 = True Then
        Command7.BackColor = &HFF&
    Else
        Command7.BackColor = &HFF00&
    End If
       
    If Form1.out_A8 = True Then
        Command8.BackColor = &HFF&
    Else
        Command8.BackColor = &HFF00&
    End If
    
    If Form1.out_A9 = True Then
        Command9.BackColor = &HFF&
    Else
        Command9.BackColor = &HFF00&
    End If
    
    If Form1.out_A10 = True Then
        Command10.BackColor = &HFF&
    Else
        Command10.BackColor = &HFF00&
    End If
    
    If Form1.out_A11 = True Then
        Command11.BackColor = &HFF&
    Else
        Command11.BackColor = &HFF00&
    End If
    
    If Form1.out_A12 = True Then
        Command12.BackColor = &HFF&
    Else
        Command12.BackColor = &HFF00&
    End If
    
    If Form1.out_A14 = True Then
        Command13.BackColor = &HFF&
    Else
        Command13.BackColor = &HFF00&
    End If
    
    If Form1.out_A16 = True Then
        Command14.BackColor = &HFF&
    Else
        Command14.BackColor = &HFF00&
    End If
    
    Timer1.Interval = 100
    Timer1.Enabled = True
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -