下載手機(jī)汽配人

50分!VB程序高手進(jìn)!用VB程序?qū)崿F(xiàn)曲柄連桿機(jī)構(gòu)運(yùn)動(dòng)

這個(gè)程序怎么做?(參考圖片我空間相冊(cè)里面有)誰(shuí)能幫我組出來,源代碼以及控件,控件應(yīng)該怎么建立?盡量要源代碼,控件的建立用語(yǔ)言描述吧!多謝了!好的答案給50分哈!!
提問者:網(wǎng)友 2018-08-21
最佳回答
'新建窗體,添加command1,label1,hscroll1,timer1,picture1 Const pi = 3.1415926 Dim angle As Integer Private Sub Form_Load() '調(diào)整空間尺寸,位置及初始參數(shù) Me.ScaleMode = 3 Me.Caption = "曲柄滑塊機(jī)構(gòu)的演示" 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圓心坐標(biāo),orad半徑 angle = (angle + HScroll1.Value) Mod 360 xo = ox + orad * Cos(angle * pi / 180) '圓周上的鉸鏈點(diǎn)坐標(biāo)(xo,yo) yo = oy + orad * Sin(angle * pi / 180) xs = Sqr((4 * orad) ^ 2 - 10 ^ 2) + xo '滑塊的左邊界x坐標(biāo),連桿長(zhǎng)度取4*orad,滑塊高度取20(像素) Picture1.BackColor = Picture1.Ba
回答者:網(wǎng)友
產(chǎn)品精選
搜索問答
還沒有汽配人賬號(hào)?立即注冊(cè)

我要提問

汽配限時(shí)折扣

本頁(yè)是網(wǎng)友提供的關(guān)于“50分!VB程序高手進(jìn)!用VB程序?qū)崿F(xiàn)曲柄連桿機(jī)構(gòu)運(yùn)動(dòng)”的解答,僅供您參考,汽配人網(wǎng)不保證該解答的準(zhǔn)確性。