100分求救,具体如下:新建一个工程,在默认的Form1上放置两个不相干的Picture1和Picture2,再放置一个Shape矩形框,将Picture2尽量拉大一些。并在Form1里面插入如下代码:Option ExplicitDim bx As Integer
Dim by As IntegerDim oLeft As Integer
Dim oTop As Integer
Dim oWidth As Integer
Dim oHeight As IntegerPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
bx = X
by = Y
oLeft = Picture1.Left
oTop = Picture1.Top
oWidth = Picture1.Width
oHeight = Picture1.Height
End If
End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Shape1.Move oLeft + (X - bx), oTop + (Y - by), oWidth, oHeight
End If
End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Picture1.Move Shape1.Left, Shape1.Top
End If
End Sub运行程序,用鼠标按住Picture1,可以发现有个Shape边框,但是每当Shape移动Picture2上时就被遮住,如何克服这个问题?
Dim by As IntegerDim oLeft As Integer
Dim oTop As Integer
Dim oWidth As Integer
Dim oHeight As IntegerPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
bx = X
by = Y
oLeft = Picture1.Left
oTop = Picture1.Top
oWidth = Picture1.Width
oHeight = Picture1.Height
End If
End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Shape1.Move oLeft + (X - bx), oTop + (Y - by), oWidth, oHeight
End If
End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Picture1.Move Shape1.Left, Shape1.Top
End If
End Sub运行程序,用鼠标按住Picture1,可以发现有个Shape边框,但是每当Shape移动Picture2上时就被遮住,如何克服这个问题?
解决方案 »
- 如何判断自动分行
- 为什么在SYSTREEVIEW32创建的的树型框右击项的空白处,会选择项。
- 哪个API是可以判断出某个exe(例如word.exe)是否处于运行状态?
- 我想对一个Form进行分区显示,如何做到?
- 数据修改(update语句)的疑问,在线等,急,马上结帖!!!!!!
- ActiveX DLL EXE 的问题
- 快帮忙呀!老板提问了,要我解决!!如何得到控件中的内容,并把它保存为一幅图片???
- 在VB中使用ADODC控件,如何共享连接呀
- 请问哪位大侠知道:怎样在数据库中存取文件!
- 还是 有关时间的问题, 来拿分哦
- SendMessage(RichTextBox.hWnd, WM_PASTE, 0, 0) 提示WM_PASTE没定义,如何处理?
- 如何随时显示更新的的数据
Option ExplicitDim bx As Integer
Dim by As IntegerDim oLeft As Integer
Dim oTop As Integer
Dim oWidth As Integer
Dim oHeight As IntegerPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
bx = X
by = Y
oLeft = Picture1.Left
oTop = Picture1.Top
oWidth = Picture1.Width
oHeight = Picture1.Height
End If
End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Text1.Visible = True
Text1.Move oLeft + (X - bx), oTop + (Y - by), oWidth, oHeight
End If
End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Picture1.Move Text1.Left, Text1.Top
Text1.Visible = False
End If
End Sub