Drag icon problem

Posted on 2005-05-10
Last Modified: 2011-09-20
In my form there are some command button each contain image
and there is one treeview control

now i  am drag item from command button to treeview and in treeview
i am creating new node programmatically

i not able to success in when i drag item form command button to
treeview my mouse icon is normal dragicon without image but i want same icon of mouse like
that command button contain ... if i drag item from another command
button then dragicon and dropicon should be shame as that command button image

this is same for inside treeview all node contain different icon if i drag and drop some node
inside treeview the icon of drag and drop is normal move and copy icon .. but i want
same icon that sourcenode contain when i drag form that node and drop some another node

any one give me any example how to make this

Question by:vsvb
    LVL 4

    Expert Comment

    use the GiveFeedBack event of the Source control...for example :

    for a button Button1

      Private Sub Button1_GiveFeedback(ByVal sender As Object, ByVal e As System.Windows.Forms.GiveFeedbackEventArgs) Handles Button1.GiveFeedback
            e.UseDefaultCursors = False
            tempCursor = New Cursor("yourpic.cur")
            Me.Cursor = tempCursor
        End Sub

    the New Cursor() constructor works for ICO files and BMP files as well...
    LVL 3

    Author Comment

    hi gopinathdeepak  thanks
    its works but..
    when my drop node on tree how can i make it again cursor again normal  mins window default one??

    LVL 4

    Expert Comment

    bring the cursor back to default by

    Me.Cursor = Cursors.Default

    on the DragDrop event of the Tree...
    LVL 4

    Accepted Solution

    more important.....remember to put the ..

    me.cursor = cursors.default

    ..code immediately after the button.DoDragDrop(....) function wherever u have called it...that will change back the cursor after the drag is completed..

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now