Dim r As Single, a As Single, b As Single, c As Single
Private Sub Form_Load()
P1.Scale (-10, -5)-(10, 5)
pi = 3.14
r = 2
HScroll1.Max = 360
HScroll1.Min = -360
HScroll2.Max = 360
HScroll2.Min = -360
HScroll3.Min = 1
HScroll3.Max = 100
Label1.Caption = "起始角度"
Label2.Caption = "终止角度"
Label3.Caption = "纵横比"
Label4.Caption = ""
Label5.Caption = ""
Label6.Caption = ""
Label4.BorderStyle = 1
Label5.BorderStyle = 1
Label6.BorderStyle = 1
P1.Line (0, 0)-((Cos(a * pi / 180)) * r, (Sin(a * pi / 180)) * r)
P1.Circle (0, 0), 3, , a, b, c
End Sub
Private Sub HScroll1_Change()
Label4.Caption = HScroll1.Value
a = HScroll1.Value
End Sub
Private Sub HScroll2_Change()
Label5.Caption = HScroll2.Value
b = HScroll2.Value
End Sub
Private Sub HScroll3_Change()
Label6.Caption = HScroll3.Value / 10
c = HScroll3.Value
End Sub
VB编程根据三个滚动条变化图形,下面是我编的程序,但是出不来图形
答案:3 悬赏:20 手机版
解决时间 2021-01-30 21:35
- 提问者网友:凉末
- 2021-01-30 13:10
最佳答案
- 五星知识达人网友:傲气稳了全场
- 2021-01-30 14:03
几个主要错误:角度没有转换为弧度,画图只是在Form_Load里面画一次,以后就没有调用了
Dim r As Single, a As Single, b As Single, c As Single
Const pi = 3.14159
Private Sub Form_Load()
P1.Scale (-10, -5)-(10, 5)
r = 2
HScroll1.Max = 360
HScroll1.Min = -360
HScroll1.Value = -90
HScroll2.Max = 360
HScroll2.Min = -360
HScroll2.Value = 90
HScroll3.Min = 1
HScroll3.Max = 100
HScroll3.Value = 100
Label1.Caption = "起始角度"
Label2.Caption = "终止角度"
Label3.Caption = "纵横比"
Label4.Caption = ""
Label5.Caption = ""
Label6.Caption = ""
Label4.BorderStyle = 1
Label5.BorderStyle = 1
Label6.BorderStyle = 1
Show
Draw
End Sub
Private Sub HScroll1_Change()
Label4.Caption = HScroll1.Value
a = HScroll1.Value
Draw
End Sub
Private Sub HScroll2_Change()
Label5.Caption = HScroll2.Value
b = HScroll2.Value
Draw
End Sub
Private Sub HScroll3_Change()
Label6.Caption = HScroll3.Value / 10
c = HScroll3.Value
Draw
End Sub
Private Sub Draw()
P1.Cls
P1.Line (0, 0)-((Cos(a * pi / 180)) * r, (Sin(a * pi / 180)) * r)
P1.Circle (0, 0), 3, , a * pi / 180, b * pi / 180, c / 100
End Sub
Dim r As Single, a As Single, b As Single, c As Single
Const pi = 3.14159
Private Sub Form_Load()
P1.Scale (-10, -5)-(10, 5)
r = 2
HScroll1.Max = 360
HScroll1.Min = -360
HScroll1.Value = -90
HScroll2.Max = 360
HScroll2.Min = -360
HScroll2.Value = 90
HScroll3.Min = 1
HScroll3.Max = 100
HScroll3.Value = 100
Label1.Caption = "起始角度"
Label2.Caption = "终止角度"
Label3.Caption = "纵横比"
Label4.Caption = ""
Label5.Caption = ""
Label6.Caption = ""
Label4.BorderStyle = 1
Label5.BorderStyle = 1
Label6.BorderStyle = 1
Show
Draw
End Sub
Private Sub HScroll1_Change()
Label4.Caption = HScroll1.Value
a = HScroll1.Value
Draw
End Sub
Private Sub HScroll2_Change()
Label5.Caption = HScroll2.Value
b = HScroll2.Value
Draw
End Sub
Private Sub HScroll3_Change()
Label6.Caption = HScroll3.Value / 10
c = HScroll3.Value
Draw
End Sub
Private Sub Draw()
P1.Cls
P1.Line (0, 0)-((Cos(a * pi / 180)) * r, (Sin(a * pi / 180)) * r)
P1.Circle (0, 0), 3, , a * pi / 180, b * pi / 180, c / 100
End Sub
全部回答
- 1楼网友:从此江山别
- 2021-01-30 16:10
指导意见:
您好,带状疱疹属于病毒感染,主要以抗病毒治疗,建议输液治疗:头孢曲松钠、利巴韦林注射液、维生素C注射液静滴。注意饮食,忌鱼虾、香菜、脂肪类、辛辣刺激性食物。避免抓挠,注意卫生。祝康复。
- 2楼网友:舊物识亽
- 2021-01-30 15:41
滚动条啊?在窗体加载时,定义一下它对value属性即可达到你要的目的。如:
private sub form_load() vscroll1.value = vscroll1.max end sub
有用你就给我加分!!
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯