如何用vb画粗的虚线

如何用vb画粗的虚线,第1张

Private Sub Command1_Click()
MeDrawStyle = 2
MeDrawWidth = 12
MeLine (10, 10)-(10000, 10000)
End Sub

Dim
s
As
Boolean,
ci
As
Integer,
xianxing
As
Integer,
xiankuan
As
Integer
Dim
x0
As
Single,
y0
As
Single
Private
Sub
Command1_Click()
s
=
True
Command1Enabled
=
False
End
Sub
Private
Sub
Form_Load()
Dim
b
b
=
Array("透明",
"实线",
"虚线",
"点线",
"点划线",
"双点划线")
Frame1Move
100,
100,
1300,
3500
Frame1Caption
=
"线型"
Frame2Move
Width
-
1500,
100,
1300,
3500
Frame2Caption
=
"线宽"
For
i
=
0
To
5
Option1(i)Move
100,
300
+
i

500,
1100,
300
Option1(i)Caption
=
b(i)
Option2(i)Move
100,
500
+
i

500,
800,
300
Option2(i)Caption
=
i
+
1
&
"点宽"
Next
i
Shape1(0)Visible
=
False
Shape1(1)Visible
=
False
s
=
0
ci
=
-1
Command1Caption
=
"开始画圆"
Command1ToolTipText
=
"点击按钮后在窗体内按下鼠标左键处为圆心,拖到半径处松开鼠标左键即可"
End
Sub
Private
Sub
Form_MouseDown(Button
As
Integer,
Shift
As
Integer,
X
As
Single,
Y
As
Single)
If
s
And
Button
=
1
Then
x0
=
X
y0
=
Y
ci
=
ci
+
1
If
ci
>
1
Then
Load
Shape1(ci)
Shape1(ci)Visible
=
True
Shape1(ci)BorderStyle
=
xianxing
Shape1(ci)Move
x0,
y0,
0,
0
Shape1(ci)Shape
=
3
Shape1(ci)BorderWidth
=
xiankuan
End
If
End
Sub
Private
Sub
Form_MouseMove(Button
As
Integer,
Shift
As
Integer,
X
As
Single,
Y
As
Single)
If
s
And
Button
=
1
Then
banjing
=
Sqr((x0
-
X)

(x0
-
X)
+
(y0
-
Y)

(y0
-
Y))
Shape1(ci)Move
x0
-
banjing,
y0
-
banjing,
2

banjing,
2

banjing
End
If
End
Sub
Private
Sub
Form_MouseUp(Button
As
Integer,
Shift
As
Integer,
X
As
Single,
Y
As
Single)
Command1Enabled
=
True
s
=
False
End
Sub
Private
Sub
Option1_Click(Index
As
Integer)
For
i
=
0
To
5
If
Option1(i)
Then
xianxing
=
i
Next
i
If
i
=
1
Then
Frame2Enabled
=
True
Else
Frame2Enabled
=
False
xiankuan
=
1
End
If
End
Sub
Private
Sub
Option2_Click(Index
As
Integer)
For
i
=
0
To
5
If
Option2(i)
Then
xiankuan
=
1
+
i
Next
i
End
Sub
界面稍微复杂了点:
一个按钮,两个框架,第一框架上option1共六个,第二个框架上option2也是六个。

VB 如何在屏幕上画一个虚线框并能设置颜色和重绘?
VB 如何在屏幕上画一个虚线框并能设置颜色和重绘?
VB 如何在屏幕上画一个虚线框并能设置颜色和重绘?
VB 如何在屏幕上画一个虚线框并能设置颜色和重绘?
VB 如何在屏幕上画一个虚线框并能设置颜色和重绘?
都没人来答哦你再到网上找找吧


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12995111.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-29
下一篇 2023-05-29

发表评论

登录后才能评论

评论列表(0条)

保存