下载手机汽配人

50分!VB程序高手进!用VB程序实现曲柄连杆机构运动

这个程序怎么做?(参考图片我空间相册里面有)谁能帮我组出来,源代码以及控件,控件应该怎么建立?尽量要源代码,控件的建立用语言描述吧!多谢了!好的答案给50分哈!!
问 提问者:网友 2018-08-21
最佳回答
'新建窗体,添加command1,label1,hscroll1,timer1,picture1 Const pi = 3.1415926 Dim angle As Integer Private Sub Form_Load() '调整空间尺寸,位置及初始参数 Me.ScaleMode = 3 Me.Caption = "曲柄滑块机构的演示" Me.Width = 5000 Me.Height = 3500 Picture1.ScaleMode = 3 Picture1.AutoRedraw = True Picture1.Move 0, 0, Me.ScaleWidth, 150 Command1.Caption = "开始(&B)" Command1.Move 20, 160, 70, 30 Label1.Caption = "速度:" Label1.Move 120, 170, 100, 30 HScroll1.Min = 1 HScroll1.Max = 20 HScroll1.Move 160, 160, 140, 30 Timer1.Interval = 20 Timer1.Enabled = False End Sub Private Sub Command1_Click() Timer1.Enabled = Not Timer1.Enabled If Timer1.Enabled Then Command1.Caption = "暂停(&S)" Else Command1.Caption = "开始(&B)" End If End Sub Sub draw(ByVal ox As Integer, ByVal oy As Integer, ByVal orad As Integer) 'ox,oy圆心坐标,orad半径 angle = (angle + HScroll1.Value) Mod 360 xo = ox + orad * Cos(angle * pi / 180) '圆周上的铰链点坐标(xo,yo) yo = oy + orad * Sin(angle * pi / 180) xs = Sqr((4 * orad) ^ 2 - 10 ^ 2) + xo '滑块的左边界x坐标,连杆长度取4*orad,滑块高度取20(像素) Picture1.BackColor = Picture1.Ba
回答者:网友
产品精选
搜索问答
还没有汽配人账号?立即注册

我要提问

汽配限时折扣

本页是网友提供的关于“50分!VB程序高手进!用VB程序实现曲柄连杆机构运动”的解答,仅供您参考,汽配人网不保证该解答的准确性。