Private Sub Command1_Click() For Each Control In Me.Controls If TypeOf Control Is Line Then Dim xx As Line Set xx = Control If xx.BorderColor = &H80000002 Then Debug.Print xx.Name xx.Visible = False 'unload xx End If End If Next End Sub
Private Sub Command1_Click() For Each Control In Me.Controls If TypeOf Control Is Line Then Debug.Print Control.Name End If Next End Sub看看能不能取到你要删除的线段。
给你个思路吧.. 如果知道线段是怎么画的,那就清空picbox,然后把另外一条重新画一下,就出来你说的那效果了,如果不知道线段是怎么画的,参考下面 按钮1按下循环扫描整个picbox内的点,取出点的颜色 if 点颜色=蓝色 then 点颜色=picbox背景色 按钮2按下 循环扫描整个picbox内的点,取出点的颜色 if 点颜色=红色 then 点颜色=picbox背景色
Private Sub Command1_Click()
For Each Control In Me.Controls
If TypeOf Control Is Line Then
Dim xx As Line
Set xx = Control
If xx.BorderColor = &H80000002 Then
Debug.Print xx.Name
xx.Visible = False
'unload xx
End If
End If
Next
End Sub
Private Sub Command1_Click()
For Each Control In Me.Controls
If TypeOf Control Is Line Then
Debug.Print Control.Name
End If
Next
End Sub看看能不能取到你要删除的线段。
http://topic.csdn.net/u/20080402/04/9cec81df-d72b-40e6-931f-232d0b927761.html
如果知道线段是怎么画的,那就清空picbox,然后把另外一条重新画一下,就出来你说的那效果了,如果不知道线段是怎么画的,参考下面
按钮1按下循环扫描整个picbox内的点,取出点的颜色
if 点颜色=蓝色 then 点颜色=picbox背景色
按钮2按下
循环扫描整个picbox内的点,取出点的颜色
if 点颜色=红色 then 点颜色=picbox背景色