Page 2 of 2 FirstFirst 12
Results 41 to 44 of 44

Thread: Movable Dynamic Controls

  1. #41
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,415

    Re: Movable Dynamic Controls

    Quote Originally Posted by SirPereira View Post
    I hope you understand something of the code lol.

    http://rapidshare.com/files/36432551...tudio.zip.html
    the problem was the wmp fills the form. i modified it for you

    http://www.scproject.biz/Zepphire%20TV%20Studio.zip

  2. #42
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,415

    Re: Movable Dynamic Controls

    Quote Originally Posted by tearsculprit View Post
    Add a Panel and all the control move inside the panel.



    When running the application, the border does not fit to the control inside the panel.



    I did make some changes to the value of Location = New Point() to make it fit well to the control...
    But do not know if i did the right things...
    ok i'll check it over tomorrow. i've gotta get some sleep

  3. #43
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,415

    Re: Movable Dynamic Controls

    tearsculprit, are the controls in the panel or on the form?

    if they're on the form, you bind them with:

    vb Code:
    1. worker.boundControls.Add(New MoveResizeControl.controlHandler.boundControl(Me, Button1))

    and if they're in the panel:

    vb Code:
    1. worker.boundControls.Add(New MoveResizeControl.controlHandler.boundControl(Panel1, Button1))

    then you also need to use the panel's MouseDown + Paint events instead of the form's events

  4. #44
    Member
    Join Date
    Feb 2010
    Posts
    36

    Re: Movable Dynamic Controls

    and if they're in the panel:

    vb Code:
    1. worker.boundControls.Add(New MoveResizeControl.controlHandler.boundControl(Panel1, Button1))

    then you also need to use the panel's MouseDown + Paint events instead of the form's events
    It works great, but when I drag the control over the initial size of the panel, the auto scroll function is on and is extending the size of panel, when I click on any place of the panel, a running error occurs (NullReferenceException - Object reference not set to an instance of an object.)... So what should I do to handle this type of error???


    vb Code:
    1. Private Sub mControl_Move(ByVal sender As Object, ByVal e As System.EventArgs)
    2.         activeControl.Invalidate() '<-- This line having error
    3.         Application.DoEvents()
    4.         drawBoundingRectangle()
    5.         paintresize()
    6. End Sub
    Last edited by tearsculprit; Mar 17th, 2010 at 09:31 PM.

Page 2 of 2 FirstFirst 12

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