I have to post a zip file and say "fix this," but can anyone help me find out what's so buggy about this code?
The goal is to move and resize the objects in runtime.
Printable View
I have to post a zip file and say "fix this," but can anyone help me find out what's so buggy about this code?
The goal is to move and resize the objects in runtime.
*BUMP* :(
What are you asking for?
The example looks to work fine
Only the bottom right corner box works on the resizing. I can't seem to find out why the others dont.
I am resizing all your controls (label, buttons and box) using the code without any change
Notice that there are four "resizing boxes" to resize the controls. Only the bottom right one works for me.
*bump*
I think I have a something at home that does a pretty good job. I will post it if I can find it when I get home.
This is your code modified and it looks to work correctly
VB Code:
Private Sub picMove_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Dim newWidth As Integer, newHeight As Integer If MoveIt = True Then Select Case Index Case 0 newHeight = picMove(3).Top - picMove(Index).Top + OldY - Y - picMove(Index).Height If newHeight >= 195 Then picMove(Index).Top = picMove(Index).Top + Y - OldY currControl.Height = newHeight currControl.Top = picMove(Index).Top + picMove(Index).Height End If newWidth = picMove(1).Left + OldX - X - picMove(Index).Left - picMove(Index).Width If newWidth >= 195 Then picMove(Index).Left = picMove(Index).Left + X - OldX currControl.Width = newWidth currControl.Left = picMove(Index).Left + picMove(Index).Width End If picMove(3).Left = picMove(0).Left picMove(1).Top = picMove(0).Top Case 1 newHeight = picMove(3).Top - picMove(Index).Top + OldY - Y - picMove(Index).Height If newHeight >= 195 Then picMove(Index).Top = picMove(Index).Top + Y - OldY currControl.Height = newHeight currControl.Top = picMove(Index).Top + picMove(Index).Height End If newWidth = (picMove(Index).Left + X - OldX) - currControl.Left If newWidth >= 195 Then picMove(Index).Left = picMove(Index).Left + X - OldX currControl.Width = newWidth End If picMove(2).Left = picMove(1).Left picMove(0).Top = picMove(1).Top Case 2 newHeight = (picMove(Index).Top + Y - OldY) - currControl.Top If newHeight >= 195 Then picMove(Index).Top = picMove(Index).Top + Y - OldY currControl.Height = newHeight End If newWidth = (picMove(Index).Left + X - OldX) - currControl.Left If newWidth >= 195 Then picMove(Index).Left = picMove(Index).Left + X - OldX currControl.Width = newWidth End If picMove(1).Left = picMove(2).Left picMove(3).Top = picMove(2).Top Case 3 newHeight = (picMove(Index).Top + Y - OldY) - currControl.Top If newHeight >= 195 Then picMove(Index).Top = picMove(Index).Top + Y - OldY currControl.Height = newHeight End If newWidth = picMove(1).Left + OldX - X - picMove(Index).Left - picMove(Index).Width If newWidth >= 195 Then picMove(Index).Left = picMove(Index).Left + X - OldX currControl.Width = newWidth currControl.Left = picMove(Index).Left + picMove(Index).Width End If picMove(0).Left = picMove(3).Left picMove(2).Top = picMove(3).Top End Select End If End Sub
Man, you are seriously my hero. Thanks alot. I'm trying to study and understand everything you changed. Thanks again, man.