Results 1 to 6 of 6

Thread: drag canvas/usercontrol...?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    32

    drag canvas/usercontrol...?

    Hi,

    I use the website below for drag and drop canvas:
    http://blogs.msdn.com/marcelolr/arch...02/542641.aspx

    I have a textbox, button and user control in my application. The user control consists of a label. When the user type text on the textbox and click on the button, the user control containing the text in the textbox will appear.
    I use the website above for drag and drop the user control but it does not work. But it works if it is not a user control. So does it means drag and drop a user control is different from canvas...? And is there any solution for it...? I'm using WPF application

    Below is a small portion of my coding:

    Dim test As New UserControl3

    Private Sub DragStarted2()

    m_IsDragging2 = True

    m_OriginalLeft2 = Canvas.GetLeft(test.textLabel)
    m_OriginalTop2 = Canvas.GetTop(test.textLabel)
    m_OriginalRight2 = Canvas.GetLeft(test.textLabel)
    m_OriginalBottom2 = Canvas.GetTop(test.textLabel)
    m_OverlayElement2 = New Rectangle()
    m_OverlayElement2.Width = m_OriginalElement2.RenderSize.Width
    m_OverlayElement2.Height = m_OriginalElement2.RenderSize.Height
    newCanvas.Children.Add(m_OverlayElement2)

    End Sub

    Thanks

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: drag canvas/usercontrol...?

    Is this the same question as: http://www.vbforums.com/showthread.php?t=556276 ?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    32

    Re: drag canvas/usercontrol...?

    It is not the same question. This thread is about dragging and dropping of canvas/user control. That thread is about not able to click on the tab control

  4. #4
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Zeist, The Netherlands
    Posts
    266

    Re: drag canvas/usercontrol...?

    If it's only a label, why are you using a custom control?

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    32

    Re: drag canvas/usercontrol...?

    Its my project requirement

  6. #6
    Hyperactive Member
    Join Date
    Mar 2008
    Location
    Zeist, The Netherlands
    Posts
    266

    Re: drag canvas/usercontrol...?

    OK. Why is it a requirement?
    What is the problem exactly? Do you get an error message? Have you placed breakpoints at crucial places to see if your events are firing as expected?

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