[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Drag icon problem

Posted on 2005-05-10
Medium Priority
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
  • 3

Expert Comment

ID: 13975289
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...

Author Comment

ID: 13975530
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??


Expert Comment

ID: 13986033
bring the cursor back to default by

Me.Cursor = Cursors.Default

on the DragDrop event of the Tree...

Accepted Solution

gopinathdeepak earned 1500 total points
ID: 13988311
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..

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

834 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