< 1 Then I = 1 If I > 9 Then I = 9 Picture1.DrawWidth = I If I < 5 Then I = 5 ctSize = I * 15 '60 '光点大小 Sha(0).FillColor = 255 '&HFFFFFF Call SetXY0 Timer1.Tag = "1" Timer1.Interval = 25 Timer1.Enabled = True End Sub Private Sub Timer1_Timer() Static n As Single, Ci As Long Dim X As Single, Y As Single, S As Single If Timer1.Tag <> "" Then Call LoadSha ctA = ctA + ctY1 If ctA > ctY0 Then ctY1 = -Abs(ctY1) If ctA <= 0 Then ctY1 = Abs(ctY1) ctB = ctB + ctX1 If ctLei = 2 Then '正弦 If ctB > Picture1.ScaleWidth * 0.45 Then ctX1 = -Abs(ctX1) Else If ctB > ctX0 Then ctX1 = -Abs(ctX1) End If If ctB <= 0 Then ctX1 = Abs(ctX1) Picture1.Cls If Val(Comb(3).Text) > 0 Then Call GetXY(0, X, Y) Picture1.PSet (X, Y) For S = 0 To ctP * 2 Step ctP / 270 Call GetXY(S, X, Y) Picture1.Line -(X, Y) Next End If n = n + ctP / 90 '180 If n > ctP * 2 Then n = 0 For I = 0 To Sha.Count - 1 S = n + I * ctP * 2 / Sha.Count If S > ctP * 2 Then S = S - ctP * 2 Call GetXY(S, X, Y) Sha(I).Move X - ctSize, Y - ctSize, ctSize * 2, ctSize * 2 Next' Timer1.Tag = "" End Sub Private Sub GetXY(n As Single, X As Single, Y As Single) Select Case ctLei Case 0 '圆 X = ctX0 + ctA * Sin(n) Y = ctY0 + ctA * Cos(n) Case 1 '椭圆 X = ctX0 + ctB * Sin(n) Y = ctY0 + ctA * Cos(n) Case 2 '正弦 X = ctX0 + n * ctB / ctP Y = ctY0 - ctA * Sin(n) End Select End Sub Private Sub LoadSha() Dim I As Long, S As Long Timer1.Tag = "" S = Val(Comb(0).Text) Sha(0).Shape = 3: Sha(0).Move 0, 0, ctSize, ctSize Sha(0).FillStyle = 0 If S > 0 Then Sha(0).Visible = True Else Sha(0).Visible = False For I = Sha.Count - 1 To 1 Step -1 Unload Sha(I) Next For I = 1 To S - 1 '光点数 Load Sha(I): Sha(I).Visible = True Next End Sub 。
【VB的代码应该怎么写】
文章插图
- 汽车钣金是什么 汽车钣金是什么颜色的
- 誓鸟的含义是什么冤禽的含义是什么志鸟的含义是什么
- 窗外的雨滴答我的心乱如麻是什么歌里面的歌词
- 自制月饼 自制月饼的保质期一般是多久
- 关胜的性格特点 关胜的性格特点及绰号
- 我和我的祖国内容 我和我的祖国内容简介300字
- 画蛇添足的歇后语 画蛇添足的歇后语补充完整
- 什么是孤寡老人 什么是孤寡老人后的作文
- 男士服装搭配的技巧 男士服装搭配的技巧上什么APP
- 四喜豆腐是哪里的菜 正宗四喜豆腐的做法