473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Drag and drop Cursor in C# Windows Forms

I'm trying to change the cursor while a drag and drop occurs between two lists in a winforms. I tried several ways (several tutorial and solutions) found over the web.

I even tried to simply change the cursor when the form loads. But as soon as the mouse moves, the cursor is back to default.

I use the following events for my drag and drop.

this.MatchRequisitionListView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.MatchR equisitionListView_MouseUp);
this.MatchRequisitionListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.MatchRe quisitionListView_DragDrop);
this.MatchRequisitionListView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.MatchR equisitionListView_MouseMove);
this.MatchRequisitionListView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MatchR equisitionListView_MouseDown);
this.MatchRequisitionListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.MatchRe quisitionListView_DragEnter);

I use this to change the cursor (didn't found a way to put and use a .cur from the LocalRessources)

IntPtr hCursor = LoadCursorFromFile("D:\\dev\\iesidebar\\trunk\\Tal eo.Plugins.IESideBar.Shared\\Resources\\3dsmove.ic o");
Cursor.Current = new Cursor(hCursor);

Even If I put this anywhere in my code, the only thing I managed to do is change the cursor on MouseDown. But as soon as I move the mouse, the dragDrop cursor is shown.

As anyone managed to do this?
Feb 7 '08 #1
1 5911
Plater
7,872 Expert 4TB
I just tried a number of different things and couldn't get anything but the normal drag and drop icons. I got the "no" sign (circle with slash through it) the drag-copy icon and the drag-move icon, but couldn't change my custom ones.


Oh, and:
System.Windows.Forms.Cursors
has a list of all the system cusors to use if need be.
Feb 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: VR | last post by:
I am trying to use a custom cursor during drag-drop operation between 2 ListViews. So, I have a code that at the time GiveFeedback() is called creates a new cursor based on the icon and text of...
5
by: Clyde | last post by:
I am trying to implement the user feedback provided by Windows Explorer when draggng a filename from one place to another. I have the drag and drop action worked out but have had no luck in...
2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
3
by: Ajay Krishnan Thampi | last post by:
I have a slight problem implementing 'drag and drop' from a datagrid to a tree-view. I have pasted my code below. Someone please advice me on what to do...pretty blur right now. ==code== ...
1
by: Terry Olsen | last post by:
My first time using TreeViews. I have TreeView1 set up to display my directory structure just like Windows Explorer. I can drag & drop files and folders over to TreeView2. I can re-arrange the...
3
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
2
by: ViRi | last post by:
I am wringing a small and lite Media Player to fit my custom needs for usage while programming. I had written some drag and drop functionality like i do with other programs, but hey, the ActiveX...
2
by: TarheelsFan | last post by:
I am having problems with drag and drop into a listview. I am able to drag and drop items from within the listview, as well as drag items from the listview and drop into a picturebox. However, I...
1
by: Sim | last post by:
Hello NG, I try to use drag and drop function between two list views. For this I found following code: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.