Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Allow the User to Resize Controls at Runtime

Allow the User to Resize Controls at Runtime

Scheduled Pinned Locked Moved Visual Studio
helpcomtutorialquestion
10 Posts 3 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JM76
    wrote on last edited by
    #1

    Hi, I was looking for information about resize User Control, and I have found this very usefull article Allow the User to Resize Controls at Runtime I must said this is very good :thumbsup:!!!, but there are some updates, and I was trying to probe it, but I have an error, and I have no idea... The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?

    Private Sub mControl_MouseDown(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.MouseEventArgs) _
    Handles mControl.MouseDown
    CreateQuiz.QuizDesignPanel.Refresh()
    mouseX = e.X
    mouseY = e.Y
    If e.Button = Windows.Forms.MouseButtons.Left Then
    mMouseDown = True
    CreateQuiz.ControlCreativePanel.Visible = False
    CreateQuiz.PicCreativePanel.Visible = False
    CreateQuiz.PanelCreativePanel.Visible = False
    End If
    End Sub

    Full code from Josh-Manson11

    Public Class ResizeableControl

    Private WithEvents mControl As Control
    Private mMouseDown As Boolean = False
    Private mEdge As EdgeEnum = EdgeEnum.None
    Private mWidth As Integer = 8
    Private mOutlineDrawn As Boolean = False
    Dim mouseX As Integer
    Dim mouseY As Integer
    
    Private Enum EdgeEnum
        None
        Right
        Left
        Top
        Bottom
        Moving
        BottomRight
        BottomLeft
        TopLeft
        TopRight
    End Enum
    
    Public Sub New(ByVal Control As Control)
        mControl = Control
    End Sub
    
    Private Sub mControl\_MouseDown(ByVal sender As Object, \_
        ByVal e As System.Windows.Forms.MouseEventArgs) \_
        Handles mControl.MouseDown
        CreateQuiz.QuizDesignPanel.Refresh()
        mouseX = e.X
        mouseY = e.Y
        If e.Button = Windows.Forms.MouseButtons.Left Then
            mMouseDown = True
            CreateQuiz.ControlCreativePanel.Visible = False
            CreateQuiz.PicCreativePanel.Visible = False
            CreateQuiz.PanelCreativePanel.Visible = False
        End If
    End Sub
    
    Private Sub mControl\_MouseUp(ByVal sender As Object, \_
        ByVal e As System.Windows.Forms.MouseEventArgs) \_
        Handles mControl.MouseUp
        mMouseDown = False
    End Sub
    
    
    
    Private SelControl As Control
    Private Sub mControl\_MouseMove(ByVal sender As Object, \_
    ByVal e As Syst
    
    L 2 Replies Last reply
    0
    • J JM76

      Hi, I was looking for information about resize User Control, and I have found this very usefull article Allow the User to Resize Controls at Runtime I must said this is very good :thumbsup:!!!, but there are some updates, and I was trying to probe it, but I have an error, and I have no idea... The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?

      Private Sub mControl_MouseDown(ByVal sender As Object, _
      ByVal e As System.Windows.Forms.MouseEventArgs) _
      Handles mControl.MouseDown
      CreateQuiz.QuizDesignPanel.Refresh()
      mouseX = e.X
      mouseY = e.Y
      If e.Button = Windows.Forms.MouseButtons.Left Then
      mMouseDown = True
      CreateQuiz.ControlCreativePanel.Visible = False
      CreateQuiz.PicCreativePanel.Visible = False
      CreateQuiz.PanelCreativePanel.Visible = False
      End If
      End Sub

      Full code from Josh-Manson11

      Public Class ResizeableControl

      Private WithEvents mControl As Control
      Private mMouseDown As Boolean = False
      Private mEdge As EdgeEnum = EdgeEnum.None
      Private mWidth As Integer = 8
      Private mOutlineDrawn As Boolean = False
      Dim mouseX As Integer
      Dim mouseY As Integer
      
      Private Enum EdgeEnum
          None
          Right
          Left
          Top
          Bottom
          Moving
          BottomRight
          BottomLeft
          TopLeft
          TopRight
      End Enum
      
      Public Sub New(ByVal Control As Control)
          mControl = Control
      End Sub
      
      Private Sub mControl\_MouseDown(ByVal sender As Object, \_
          ByVal e As System.Windows.Forms.MouseEventArgs) \_
          Handles mControl.MouseDown
          CreateQuiz.QuizDesignPanel.Refresh()
          mouseX = e.X
          mouseY = e.Y
          If e.Button = Windows.Forms.MouseButtons.Left Then
              mMouseDown = True
              CreateQuiz.ControlCreativePanel.Visible = False
              CreateQuiz.PicCreativePanel.Visible = False
              CreateQuiz.PanelCreativePanel.Visible = False
          End If
      End Sub
      
      Private Sub mControl\_MouseUp(ByVal sender As Object, \_
          ByVal e As System.Windows.Forms.MouseEventArgs) \_
          Handles mControl.MouseUp
          mMouseDown = False
      End Sub
      
      
      
      Private SelControl As Control
      Private Sub mControl\_MouseMove(ByVal sender As Object, \_
      ByVal e As Syst
      
      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Please use the forum at the end of the article to contact the author.

      J 1 Reply Last reply
      0
      • L Lost User

        Please use the forum at the end of the article to contact the author.

        J Offline
        J Offline
        JM76
        wrote on last edited by
        #3

        Hi Richard Thank you very much for your reply and your suggestion. The problem is this code not belongs to the autor , for this reason, I ask in the forum, if you believe not is correct, please delete it. Thanks Advanced-

        Richard Andrew x64R 1 Reply Last reply
        0
        • J JM76

          Hi Richard Thank you very much for your reply and your suggestion. The problem is this code not belongs to the autor , for this reason, I ask in the forum, if you believe not is correct, please delete it. Thanks Advanced-

          Richard Andrew x64R Offline
          Richard Andrew x64R Offline
          Richard Andrew x64
          wrote on last edited by
          #4

          JM76 wrote:

          The problem is this code not belongs to the autor

          To whom does the code belong, then? Did you write it?

          The difficult we do right away... ...the impossible takes slightly longer.

          J 1 Reply Last reply
          0
          • Richard Andrew x64R Richard Andrew x64

            JM76 wrote:

            The problem is this code not belongs to the autor

            To whom does the code belong, then? Did you write it?

            The difficult we do right away... ...the impossible takes slightly longer.

            J Offline
            J Offline
            JM76
            wrote on last edited by
            #5

            Hi Richard Andrew Of course I did, if you read again, you will see it. Full code from Josh-Manson11 I know my english is not good, sorry... Thanks

            1 Reply Last reply
            0
            • J JM76

              Hi, I was looking for information about resize User Control, and I have found this very usefull article Allow the User to Resize Controls at Runtime I must said this is very good :thumbsup:!!!, but there are some updates, and I was trying to probe it, but I have an error, and I have no idea... The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?

              Private Sub mControl_MouseDown(ByVal sender As Object, _
              ByVal e As System.Windows.Forms.MouseEventArgs) _
              Handles mControl.MouseDown
              CreateQuiz.QuizDesignPanel.Refresh()
              mouseX = e.X
              mouseY = e.Y
              If e.Button = Windows.Forms.MouseButtons.Left Then
              mMouseDown = True
              CreateQuiz.ControlCreativePanel.Visible = False
              CreateQuiz.PicCreativePanel.Visible = False
              CreateQuiz.PanelCreativePanel.Visible = False
              End If
              End Sub

              Full code from Josh-Manson11

              Public Class ResizeableControl

              Private WithEvents mControl As Control
              Private mMouseDown As Boolean = False
              Private mEdge As EdgeEnum = EdgeEnum.None
              Private mWidth As Integer = 8
              Private mOutlineDrawn As Boolean = False
              Dim mouseX As Integer
              Dim mouseY As Integer
              
              Private Enum EdgeEnum
                  None
                  Right
                  Left
                  Top
                  Bottom
                  Moving
                  BottomRight
                  BottomLeft
                  TopLeft
                  TopRight
              End Enum
              
              Public Sub New(ByVal Control As Control)
                  mControl = Control
              End Sub
              
              Private Sub mControl\_MouseDown(ByVal sender As Object, \_
                  ByVal e As System.Windows.Forms.MouseEventArgs) \_
                  Handles mControl.MouseDown
                  CreateQuiz.QuizDesignPanel.Refresh()
                  mouseX = e.X
                  mouseY = e.Y
                  If e.Button = Windows.Forms.MouseButtons.Left Then
                      mMouseDown = True
                      CreateQuiz.ControlCreativePanel.Visible = False
                      CreateQuiz.PicCreativePanel.Visible = False
                      CreateQuiz.PanelCreativePanel.Visible = False
                  End If
              End Sub
              
              Private Sub mControl\_MouseUp(ByVal sender As Object, \_
                  ByVal e As System.Windows.Forms.MouseEventArgs) \_
                  Handles mControl.MouseUp
                  mMouseDown = False
              End Sub
              
              
              
              Private SelControl As Control
              Private Sub mControl\_MouseMove(ByVal sender As Object, \_
              ByVal e As Syst
              
              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              JM76 wrote:

              The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?

              That code did not appear in the article. It looks like someone is trying to hide some panels on a nastily named form. Remove the lines and see if you can resize the control.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

              J 1 Reply Last reply
              0
              • L Lost User

                JM76 wrote:

                The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?

                That code did not appear in the article. It looks like someone is trying to hide some panels on a nastily named form. Remove the lines and see if you can resize the control.

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                J Offline
                J Offline
                JM76
                wrote on last edited by
                #7

                Eddy Vluggen wrote:

                That code did not appear in the article. It looks like someone is trying to hide some panels on a nastily named form. Remove the lines and see if you can resize the control.

                Hi Eddy Yes, I tried it, but do not work for me. Thank you very much

                L 1 Reply Last reply
                0
                • J JM76

                  Eddy Vluggen wrote:

                  That code did not appear in the article. It looks like someone is trying to hide some panels on a nastily named form. Remove the lines and see if you can resize the control.

                  Hi Eddy Yes, I tried it, but do not work for me. Thank you very much

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Why did you add those lines? What is "CreateQuiz" supposed to do?

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                  J 1 Reply Last reply
                  0
                  • L Lost User

                    Why did you add those lines? What is "CreateQuiz" supposed to do?

                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                    J Offline
                    J Offline
                    JM76
                    wrote on last edited by
                    #9

                    Hi Eddy You are right!!! :) I delete this lines, and delete the Msgbox, and now work very well!!! :thumbsup: As always thank you so much for your help. ;) Regards JM

                    L 1 Reply Last reply
                    0
                    • J JM76

                      Hi Eddy You are right!!! :) I delete this lines, and delete the Msgbox, and now work very well!!! :thumbsup: As always thank you so much for your help. ;) Regards JM

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      You're welcome :)

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups