Results 1 to 5 of 5

Thread: Need help with my first application

  1. #1

    Thread Starter
    New Member Roast247's Avatar
    Join Date
    Jan 2021
    Posts
    15

    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!

  2. #2
    Hyperactive Member
    Join Date
    Jan 2013
    Posts
    485

    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.

  3. #3

    Thread Starter
    New Member Roast247's Avatar
    Join Date
    Jan 2021
    Posts
    15

    Re: Need help with my first application

    Quote Originally Posted by georgesutfin View Post
    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

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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
  •  



Click Here to Expand Forum to Full Width