Results 1 to 2 of 2

Thread: Drag and dropping User Controls

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    97

    Unhappy Drag and dropping User Controls

    I've got another questions about User Controls!

    I want to move a control around the screen by simple dragging and dropping. I've done this very easily in the code for the form that an instance of the control exists on.

    However I don't want to have to add the code to drag and drop the control (and goto a function that aligns it to grid coords) every time I put the control on a new form. Ideally I want the drag and drop code in with the code for the User Control itself. I was thinking that it would be something like this:

    Code:
    Private Sub LabelOnControl_MouseDown(Button as Integer.....)
           UserControl.Drag
    End Sub
    but it doesn't like that!

    Any ideas how I can do this? Is OLEdrag useful? I couldn't work out how this differed to normal drag and drop.

    thanks

    Paul

  2. #2
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Drag and dropping User Controls

    VB Code:
    1. Private Sub LabelOnControl_MouseDown(Button as Integer.....)
    2.        LabelOnControl.Drag
    3. End Sub

    Maybe this might work

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