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

📄 dialog.frm

📁 PC机与单片机的串口通信程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Dialog 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "高级选项"
   ClientHeight    =   2940
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   4185
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2940
   ScaleWidth      =   4185
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.TextBox Set_time 
      Height          =   375
      Left            =   1680
      TabIndex        =   6
      Text            =   "10"
      Top             =   1440
      Width           =   495
   End
   Begin VB.TextBox Set_Len 
      Height          =   375
      Left            =   1680
      TabIndex        =   5
      Text            =   "500"
      Top             =   840
      Width           =   495
   End
   Begin VB.OptionButton Option3 
      Caption         =   "运行"
      Height          =   375
      Left            =   840
      TabIndex        =   4
      Top             =   1440
      Width           =   735
   End
   Begin VB.OptionButton Option2 
      Caption         =   "采集"
      Height          =   375
      Left            =   840
      TabIndex        =   3
      Top             =   840
      Width           =   735
   End
   Begin VB.OptionButton Option1 
      Caption         =   "手动停止"
      Height          =   375
      Left            =   840
      TabIndex        =   2
      Top             =   240
      Value           =   -1  'True
      Width           =   1335
   End
   Begin VB.CommandButton CancelButton 
      Caption         =   "取消"
      Height          =   375
      Left            =   2640
      TabIndex        =   1
      Top             =   2160
      Width           =   1215
   End
   Begin VB.CommandButton OKButton 
      Caption         =   "确定"
      Height          =   375
      Left            =   840
      TabIndex        =   0
      Top             =   2160
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "分钟后停止"
      Height          =   255
      Left            =   2280
      TabIndex        =   8
      Top             =   1560
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "帧后停止"
      Height          =   255
      Left            =   2280
      TabIndex        =   7
      Top             =   960
      Width           =   855
   End
End
Attribute VB_Name = "Dialog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit



Private Sub Form_Load()
    If Form1.Option_Num = 1 Then
        Option1.Value = True
        Set_Len.Enabled = False
        Set_time.Enabled = False
        
    ElseIf Form1.Option_Num = 2 Then
        Option2.Value = True
        Set_time.Enabled = False
        Set_Len.Text = CStr(Form1.Option_Content)
    ElseIf Form1.Option_Num = 3 Then
        Option3.Value = True
        Set_Len.Enabled = False
        Set_time.Text = CStr(Form1.Option_Content)
    End If
    
End Sub

Private Sub OKButton_Click()
    If Option1.Value = True Then
        Form1.Option_Num = 1
    ElseIf Option2.Value = True Then
        If CInt(Set_Len.Text) <= 0 Or CInt(Set_Len.Text) > 10000 Then
            MsgBox "输入的数据不合法,请正确输入!"
            Set_Len.SetFocus
            GoTo fback
        End If
        Form1.Option_Num = 2
        Form1.Option_Content = CInt(Set_Len.Text)
    Else
        If CInt(Set_time.Text) <= 0 Or CInt(Set_time.Text) > 10000 Then
            MsgBox "输入的数据不合法,请正确输入!"
            Set_time.SetFocus
            GoTo fback
        End If
        Form1.Option_Num = 3
        Form1.Option_Content = CInt(Set_time.Text)
    End If
    Unload Dialog
fback:
End Sub
Private Sub CancelButton_Click()
    Unload Dialog
End Sub

Private Sub Option1_Click()
    Set_time.Enabled = False
    Set_Len.Enabled = False
End Sub

Private Sub Option2_Click()
    Set_time.Enabled = False
    Set_Len.Enabled = True
    'Set_Len.SetFocus
End Sub

Private Sub Option3_Click()
    Set_Len.Enabled = False
    Set_time.Enabled = True
    'Set_time.SetFocus
End Sub

⌨️ 快捷键说明

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