[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Change Cursor During Drag And Drop VB.NET

Posted on 2014-07-11
5
Medium Priority
?
666 Views
Last Modified: 2014-07-21
A have a label “Label2” that I am coping data from and to a textbox named “textbox2” using drag and drop which works fine. I would like to change the default cursor to the data being dragged until the process is complete. It that doable?
VB.NET 2013 windows form
0
Comment
Question by:mickeyshelley1
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
quizwedge earned 2000 total points
ID: 40192618
There are a bunch of different cursors you can use using the CSS cursor property. You can check them out by hovering over the different options at http://css-tricks.com/almanac/properties/c/cursor/ or the most widely compatible ones can be found below. You can even use an image such as

.custom {
   cursor: url(images/my-cursor.png), auto;
}

Open in new window

Sounds like you want the actual text to be the cursor though. The only way I could think to do this is to somehow generate an image on the fly and use that image. Not sure if there'd be enough time to generate an image before the person finished dragging and dropping. Might be better to make a default image instead.

Cursors:
.auto            { cursor: auto; }
.default         { cursor: default; }
.none            { cursor: none; }
.context-menu    { cursor: context-menu; }
.help            { cursor: help; }
.pointer         { cursor: pointer; }
.progress        { cursor: progress; }
.wait            { cursor: wait; }
.cell            { cursor: cell; }
.crosshair       { cursor: crosshair; }
.text            { cursor: text; }
.vertical-text   { cursor: vertical-text; }
.alias           { cursor: alias; }
.copy            { cursor: copy; }
.move            { cursor: move; }
.no-drop         { cursor: no-drop; }
.not-allowed     { cursor: not-allowed; }
.all-scroll      { cursor: all-scroll; }
.col-resize      { cursor: col-resize; }
.row-resize      { cursor: row-resize; }
.n-resize        { cursor: n-resize; }
.e-resize        { cursor: e-resize; }
.s-resize        { cursor: s-resize; }
.w-resize        { cursor: w-resize; }
.ns-resize       { cursor: ns-resize; }
.ew-resize       { cursor: ew-resize; }
.ne-resize       { cursor: ne-resize; }
.nw-resize       { cursor: nw-resize; }
.se-resize       { cursor: se-resize; }
.sw-resize       { cursor: sw-resize; }
.nesw-resize     { cursor: nesw-resize; }
.nwse-resize     { cursor: nwse-resize; }

Open in new window

0
 
LVL 84

Expert Comment

by:David Johnson, CD, MVP
ID: 40192646
he is using winforms so
you have to set e.UseDefaultCursor = False in your GiveFeedback event handler to make your cursor change visible. Without it, drag and drop always uses the default cursors.

stackoverflow.com/questions/5206999/change-cursor-as-feedback-in-dragdrop-vb-net-2010
0
 
LVL 14

Expert Comment

by:quizwedge
ID: 40192655
Ah, good catch David. Looked quickly and saw .NET and that it had been moved from Classic. Missed the last line of his question. My bad.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

831 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