📄 signalsource.frm
字号:
VERSION 5.00
Begin VB.Form signalsource
Caption = "函数信号发生器"
ClientHeight = 1890
ClientLeft = 60
ClientTop = 345
ClientWidth = 3015
Icon = "signalsource.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1890
ScaleWidth = 3015
ShowInTaskbar = 0 'False
Visible = 0 'False
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 495
Left = 0
ScaleHeight = 465
ScaleWidth = 2985
TabIndex = 9
Top = 0
Width = 3015
Begin VB.Image Image1
Height = 480
Index = 2
Left = 480
Picture = "signalsource.frx":0CCA
Top = 0
Width = 1965
End
Begin VB.Image Image1
Height = 480
Index = 1
Left = 480
Picture = "signalsource.frx":3E8C
Top = 0
Width = 1965
End
Begin VB.Image Image1
Height = 480
Index = 0
Left = 480
Picture = "signalsource.frx":704E
Top = 0
Width = 1965
End
End
Begin VB.TextBox Text3
Height = 270
Left = 720
TabIndex = 8
Text = "0"
Top = 1560
Width = 2055
End
Begin VB.TextBox Text2
Height = 270
Left = 720
TabIndex = 6
Text = "1"
Top = 1200
Width = 2055
End
Begin VB.TextBox Text1
Height = 270
Left = 720
TabIndex = 4
Text = "1000"
Top = 840
Width = 2055
End
Begin VB.CommandButton Command1
Caption = "三角波"
Height = 255
Index = 2
Left = 1920
TabIndex = 2
Top = 480
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "方波"
Height = 255
Index = 1
Left = 960
TabIndex = 1
Top = 480
Width = 975
End
Begin VB.CommandButton Command1
Caption = "正弦波"
Height = 255
Index = 0
Left = 0
TabIndex = 0
Top = 480
Width = 975
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "相位"
Height = 255
Left = 0
TabIndex = 7
Top = 1560
Width = 855
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "幅值"
Height = 255
Left = 120
TabIndex = 5
Top = 1200
Width = 615
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "频率"
Height = 255
Left = 120
TabIndex = 3
Top = 840
Width = 615
End
End
Attribute VB_Name = "signalsource"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Dim retvalue As Long
Public Sub Command1_Click(Index As Integer)
Dim k As Integer
For k = 0 To 2
If k = Index Then
Image1(k).Visible = True
Else
Image1(k).Visible = False
End If
Next k
multisignal.stype = Index
If Index = 0 Then
multisignal.times = 1
ElseIf Index = 1 Then
multisignal.times = 15
Else
multisignal.times = 15
End If
End Sub
Private Sub Form_Load()
retvalue = SetWindowPos(Me.hwnd, -1, Me.CurrentX, Me.CurrentY, 208, 150, &H40)
'置中窗体
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
multisignal.arc = 0
multisignal.frequency = 1000
multisignal.volt = 1
multisignal.stype = 0
multisignal.times = 1
End Sub
Private Sub Form_Unload(cancel As Integer)
If formstate = 1 Then
cancel = 0
Else
cancel = 1
signalsource.Hide
End If
End Sub
Private Sub Text1_Change()
If CSng(Text1.Text) > 0 Then
multisignal.frequency = CSng(Text1.Text)
Else
MsgBox "请正确输入频率!"
End If
End Sub
Private Sub Text2_Change()
If CSng(Text2.Text) > 0 Then
multisignal.volt = CSng(Text2.Text)
Else
MsgBox "请正确输入电压值!"
End If
End Sub
Private Sub Text3_Change()
multisignal.frequency = CSng(Text1.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -