-
Jan 18th, 2021, 04:54 PM
#1
Thread Starter
New Member
Need help with my first application
Hi, I just built my first application and I am having a lot of trouble with resizing code. I watched a few youtube videos and got some help there, but there are some bugs that I need help working out. I uploaded the project to GitHub at https://github.com/roast247/IRC-Chat...Code-Version-2
Any and all help will be much appreciated!
-
Jan 18th, 2021, 06:43 PM
#2
Hyperactive Member
Re: Need help with my first application
You need to post your code here. You do so by copying and pasting your code between hashtags. The hashtags are in the toolbar above. You also need to describe what problem your having.
-
Jan 18th, 2021, 07:27 PM
#3
Thread Starter
New Member
Re: Need help with my first application
Originally Posted by georgesutfin
You need to post your code here. You do so by copying and pasting your code between hashtags. The hashtags are in the toolbar above. You also need to describe what problem your having.
The UpR, DownR, LeftR, and RightR are all picture boxes, I'm having an issue where when I resize from the top going down and it hits the minimum application limit that I placed, the whole app moves. It also happens when going from the left to right. The project is on github for anyone who wants to check it out and see what wrong, and the code below is what I used for the specific function I'm trying to do.
Code:
Private Sub DownR_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DownR.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Size = New Size(Me.Size.Width, MousePosition.Y - Me.Location.Y)
End If
End Sub
Private Sub LeftR_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LeftR.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Size = New Size(Me.Size.Width + (Me.Location.X - MousePosition.X), Me.Size.Height)
Me.Location = New Point(MousePosition.X, Me.Location.Y)
End If
End Sub
Private Sub RightR_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles RightR.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Size = New Size(MousePosition.X - Me.Location.X, Me.Size.Height)
End If
End Sub
Private Sub UpR_MouseMove(sender As Object, e As MouseEventArgs) Handles UpR.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Size = New Size(Me.Size.Width, Me.Size.Height + (Me.Location.Y - MousePosition.Y))
Me.Location = New Point(Me.Location.X, MousePosition.Y)
End If
End Sub
-
Jan 18th, 2021, 09:28 PM
#4
Re: Need help with my first application
So you're saying that you want something to happen only IF a specific condition is satisfied? I wonder whether VB has a code construct that can do that.
Also, if you are only resizing in one direction at a time then don't set the Size and Location properties. Use Top to move vertically and Left to move horizontally; use Height to resize vertically and Width to resize horizontally. If you want to move and resize then call SetBounds, which will allow you to specify which elements of the bounds you're setting and to do it in one operation instead of two.
-
Jan 18th, 2021, 09:30 PM
#5
Re: Need help with my first application
For future reference, please provide a title that actually summarises the issue you're having. Your title tells us nothing of use. We should be able to tell whether the thread is relevant to us from the title alone. People who volunteer their time to help others don't want to have to open every thread in order to know which of those they can actually help with. You should do all you can to help us help you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|