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

📄 yibiaoshezhi.frm

📁 Visual Basic实现PC机与单片机串口通信任务 包含visual basic 和51的原代码
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         ItemData        =   "yibiaoshezhi.frx":00D4
         Left            =   600
         List            =   "yibiaoshezhi.frx":00E4
         Style           =   2  'Dropdown List
         TabIndex        =   14
         Top             =   360
         Width           =   975
      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          =   495
         Left            =   120
         TabIndex        =   12
         Top             =   360
         Width           =   495
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "外观设置"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3375
      Left            =   360
      TabIndex        =   0
      Top             =   480
      Width           =   2655
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   960
         TabIndex        =   11
         Text            =   "Text1"
         Top             =   360
         Width           =   855
      End
      Begin VB.CommandButton Command5 
         Caption         =   "……"
         Height          =   615
         Left            =   960
         Style           =   1  'Graphical
         TabIndex        =   10
         Top             =   2160
         Width           =   855
      End
      Begin VB.CommandButton Command4 
         Caption         =   "……"
         Height          =   495
         Left            =   960
         MaskColor       =   &H8000000F&
         Style           =   1  'Graphical
         TabIndex        =   9
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label7 
         Caption         =   "mm"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2040
         TabIndex        =   22
         Top             =   600
         Width           =   375
      End
      Begin VB.Label Label1 
         Caption         =   "表盘颜色"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   3
         Left            =   240
         TabIndex        =   8
         Top             =   2280
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "表壳颜色"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   2
         Left            =   240
         TabIndex        =   7
         Top             =   1320
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "表盘宽度"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Index           =   0
         Left            =   240
         TabIndex        =   6
         Top             =   360
         Width           =   495
      End
   End
End
Attribute VB_Name = "yibiaoshezhi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Zuida As Single, Zuixiao As Integer

Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer, d As Integer, e As Integer, f As Integer, g As Integer, h As Integer
Zhizhen = Val(Text1.Text) / 4
frmain.shezhibiaopan
frmain.huadian

a = combo1.ListIndex
If a >= 0 Then       '设置表针粗细
For i = 0 To 4
frmain.biaozhen(i).BorderWidth = 1 + i + a
Next i
End If

b = Combo2.ListIndex    '设置刻度线精细
If b >= 0 Then
frmain.biaopan.DrawWidth = b + 1
frmain.shezhibiaopan
End If


c = Val(Combo3)   '设置主、分刻度范围
d = Val(Combo4)
If c And d <> 0 Then
Zhukedushu = c
Fenkedushu = d
frmain.shezhibiaopan
End If
If c <> 0 And d = 0 Then
Zhukedushu = c
frmain.shezhibiaopan
End If
If d <> 0 And c = 0 Then
Fenkedushu = d
frmain.shezhibiaopan
End If

e = Val(da.Text)    '刻度值范围设置
f = Val(xiao.Text)
If e <> Zuidazhi Or f <> Zuixiaozhi Then
Zuidazhi = e
Zuixiaozhi = f
frmain.shezhibiaopan
End If


If h <> -1 Then
g = Val(Combo5)   '设定外界输入数值的小数位
If g = 0 Then frmain.celiangzhi.Text = Format$(JISHOUZHI, "000")
If g = 1 Then frmain.celiangzhi.Text = Format$(JISHOUZHI, "000.0")
If g = 2 Then frmain.celiangzhi.Text = Format$(JISHOUZHI, "000.00")
If g = 3 Then frmain.celiangzhi.Text = Format$(JISHOUZHI, "000.000")
End If
Dim ls As Single    '重重表针位置
Dongtaishu = Val(frmain.celiangzhi.Text)
ls = PI - (Dongtaishu - Zuixiaozhi) * PI / (Zuidazhi - Zuixiaozhi)
frmain.biaozhenxuanzhuan ls

Unload Me   '卸载参数设置对话框
End Sub

Private Sub Command11_Click()  '设置接收的字体
yanseshezhi.Flags = 3
yanseshezhi.ShowFont
If yanseshezhi.FontName <> "" Then frmain.celiangzhi.FontName = yanseshezhi.FontName
frmain.celiangzhi.FontSize = yanseshezhi.FontSize
frmain.celiangzhi.FontBold = yanseshezhi.FontBold
frmain.celiangzhi.FontItalic = yanseshezhi.FontItalic
frmain.celiangzhi.FontUnderline = yanseshezhi.FontUnderline
frmain.celiangzhi.FontStrikethru = yanseshezhi.FontStrikethru
frmain.shezhibiaopan
End Sub

Private Sub Command2_Click()
Dim a As Integer, b As Integer, c As Integer, d As Integer, e As Integer, f As Integer, g As Integer, h As Integer
Zhizhen = Val(Text1.Text) / 4
frmain.shezhibiaopan
frmain.huadian

a = combo1.ListIndex
If a >= 0 Then       '设置表针粗细
For i = 0 To 4
frmain.biaozhen(i).BorderWidth = 1 + i + a
Next i
End If

b = Combo2.ListIndex    '设置刻度线精细
If b >= 0 Then
frmain.biaopan.DrawWidth = b + 1
frmain.shezhibiaopan
End If

c = Val(Combo3)   '设置主、分刻度范围
d = Val(Combo4)
If c And d <> 0 Then
Zhukedushu = c
Fenkedushu = d
frmain.shezhibiaopan
End If
If c <> 0 And d = 0 Then
Zhukedushu = c
frmain.shezhibiaopan
End If
If d <> 0 And c = 0 Then
Fenkedushu = d
frmain.shezhibiaopan
End If

e = Val(da.Text)    '刻度值范围设置
f = Val(xiao.Text)
If e <> Zuidazhi Or f <> Zuixiaozhi Then
Zuidazhi = e
Zuixiaozhi = f
frmain.shezhibiaopan
End If

h = Combo5.ListIndex
If h <> -1 Then
g = Val(Combo5)   '设定外界输入数值的小数位
If g = 0 Then frmain.celiangzhi.Text = Format$(JISHOUZHI, "000")
If g = 1 Then frmain.celiangzhi.Text = Format$(JISHOUZHI, "000.0")
If g = 2 Then frmain.celiangzhi.Text = Format$(JISHOUZHI, "000.00")
If g = 3 Then frmain.celiangzhi.Text = Format$(JISHOUZHI, "000.000")
End If
Dim ls As Single       '重重表针位置
Dongtaishu = Val(frmain.celiangzhi.Text)
ls = PI - (Dongtaishu - Zuixiaozhi) * PI / (Zuidazhi - Zuixiaozhi)
frmain.biaozhenxuanzhuan ls
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
yanseshezhi.Flags = 2
yanseshezhi.Color = BackColor
yanseshezhi.Action = 3
frmain.biaoke.BackColor = yanseshezhi.Color
frmain.shezhibiaopan
End Sub

Private Sub Command5_Click()
yanseshezhi.Flags = 2
yanseshezhi.Color = BackColor
yanseshezhi.Action = 3
frmain.biaopan.BackColor = yanseshezhi.Color
frmain.shezhibiaopan
End Sub

Private Sub Command6_Click()
yanseshezhi.Flags = 2
yanseshezhi.Color = BackColor
yanseshezhi.Action = 3
For i = 0 To 4
frmain.biaozhen(i).BorderColor = yanseshezhi.Color
Next i
End Sub

Private Sub Command7_Click()
yanseshezhi.Flags = 2
yanseshezhi.Color = BackColor
yanseshezhi.Action = 3
frmain.biaopan.ForeColor = yanseshezhi.Color
frmain.shezhibiaopan

End Sub

Private Sub Command8_Click()
yanseshezhi.Flags = 2
yanseshezhi.Color = BackColor
yanseshezhi.Action = 3
For i = 0 To Zhukedushu
frmain.keduzhi(i).ForeColor = yanseshezhi.Color
Next i
End Sub

Private Sub Command9_Click()    '设置刻度值字体
yanseshezhi.Flags = 3
yanseshezhi.ShowFont
For i = 0 To Zhukedushu
If yanseshezhi.FontName <> "" Then frmain.keduzhi(i).FontName = yanseshezhi.FontName
frmain.keduzhi(i).FontSize = yanseshezhi.FontSize
frmain.keduzhi(i).FontBold = yanseshezhi.FontBold
frmain.keduzhi(i).FontItalic = yanseshezhi.FontItalic
frmain.keduzhi(i).FontUnderline = yanseshezhi.FontUnderline
frmain.keduzhi(i).FontStrikethru = yanseshezhi.FontStrikethru
Next i
frmain.shezhibiaopan
End Sub

Private Sub Form_Load()
Text1.Text = Format$(frmain.biaoke.Width / ZH, "###.##")  '几个控件赋初值
da.Text = Zuidazhi
xiao.Text = Zuixiaozhi

Command1.Default = True   '回车键等于"确定"按钮
Command3.Cancel = True   'ESC键等于"取消"按钮

End Sub


⌨️ 快捷键说明

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