📄 frminput.frm
字号:
VERSION 5.00
Begin VB.Form frminput
Caption = "Form2"
ClientHeight = 5265
ClientLeft = 60
ClientTop = 450
ClientWidth = 7590
LinkTopic = "Form2"
ScaleHeight = 5265
ScaleWidth = 7590
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdcancel
Caption = "取消"
Height = 495
Left = 5520
TabIndex = 10
Top = 4200
Width = 1215
End
Begin VB.CommandButton cmdinput
Caption = "重新输入"
Height = 495
Left = 3120
TabIndex = 9
Top = 4200
Width = 1215
End
Begin VB.CommandButton cmdyes
Caption = "确定"
Height = 495
Left = 720
TabIndex = 8
Top = 4200
Width = 1215
End
Begin VB.TextBox Text3
Height = 495
Left = 2280
TabIndex = 7
Text = " "
Top = 3120
Width = 1215
End
Begin VB.TextBox Text2
Height = 495
Left = 5640
TabIndex = 6
Text = " "
Top = 2040
Width = 1215
End
Begin VB.TextBox Text1
Height = 495
Left = 2040
TabIndex = 5
Text = " "
Top = 2040
Width = 1215
End
Begin VB.Label Label5
Caption = "循环次数"
Height = 495
Left = 480
TabIndex = 4
Top = 3120
Width = 1215
End
Begin VB.Label Label4
Caption = "Y轴比例"
Height = 495
Left = 4080
TabIndex = 3
Top = 2040
Width = 1215
End
Begin VB.Label Label3
Caption = "X轴比例"
Height = 495
Left = 480
TabIndex = 2
Top = 2040
Width = 1215
End
Begin VB.Label Label2
Caption = "(X轴比例:100:Y轴比例:100;循环次数:1)"
Height = 495
Left = 480
TabIndex = 1
Top = 960
Width = 4095
End
Begin VB.Label Label1
Caption = "请输入正弦曲线的参数"
Height = 375
Left = 480
TabIndex = 0
Top = 120
Width = 2295
End
End
Attribute VB_Name = "frminput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const PI = 3.1415926
Dim x0, y0, xScale, yScale, n As Integer
Private Sub CmdYes_Click()
Dim i As Double
x0 = 10: y0 = 240
Dim x, y, xOld, yOld As Integer
xOld = 0: yOld = 0
xScale = Val(frminput.Text1)
yScale = Val(frminput.Text2)
n = Val(frminput.Text3)
frmline.pictdraw.Cls
frmline.pictdraw.AutoRedraw = True
x0 = 315: y0 = 240
frmline.pictdraw.Line (0, y0)-(639, y0)
frmline.pictdraw.Line (x0, 100)-(x0, 380)
For i = 0 To 2 * PI Step 2 * PI / 100
x = xScale * Sin(2 * i)
y = yScale * Sin(3 * i)
frmline.pictdraw.Line (xOld + x0, yOld + y0)-(x + x0, y + y0)
xOld = x: yOld = y
Next i
Unload frminput
End Sub
Private Sub CmdCancel_Click()
Unload frminput
End Sub
Private Sub CmdInput_Click()
frminput.Text1 = ""
frminput.Text2 = ""
frminput.Text3 = ""
End Sub
Private Sub Form_Load()
Dim xScale, yScale, n
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -