Solved

Cursor

Posted on 1998-10-08
8
271 Views
Last Modified: 2010-08-05
Hello,

In windows 95 explorer, when you drag an item from the listview, the cursor change and reproduce the item. How can I do this in visual basic ? (i would like to drag a color box and my cursor reproduce this color box when i drag it).

Thanks a lot
Nathalie
0
Comment
Question by:sidjey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 2

Expert Comment

by:shchuka
ID: 1438880
You need to set the DragIcon property of whatever control you are dragging.  This way the icon you set will be shown when dragged.

-Aleks.
0
 

Author Comment

by:sidjey
ID: 1438881
I know but I don't know how can I reproduce the item in the dragicon.
0
 
LVL 2

Expert Comment

by:shchuka
ID: 1438882
I don't think that Windows Explorer "reproduces" the icons when you drag something.  If it does, than it does some nighty stuff with graphics manipulation, basically taking the "screen shot" of the item, then creating the icon on the fly.  You can try doing something like that, but I don't think it'll be easy - and definitely once you create this icos (with API calls of course), you won't be able to simply assign them to the DragIcon property of control.
0
Independent Software Vendors: 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!

 
LVL 1

Expert Comment

by:xer_soft
ID: 1438883
sidjey- Are the icons always going to be changing or is there only going to be a few you will need to "Drag"? Because you could (if there were only going to be a few) just make up a bunch of icons and then have the cursor change to these icons when needed. I don't think I am doing a very good job of explaining so let me think about how to say it better. If you don't under stand just say.
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1438884
You can use ListItem.CreateDragImage
0
 

Author Comment

by:sidjey
ID: 1438885
It's ok for a listview but not for another control. I've a picturebox with a custom palette (createpalette). When I click on this picture, a small box appears with the color selected. I would like to drag this small box and the dragicon reproduce this small box with the same color. I don't know if it possible.
If you know how can i do this, please help me.
Thanks a lot
Nathalie
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1438886
You can create a hidden listview, and use it's CreateDragImage method
0
 
LVL 5

Accepted Solution

by:
AnswerTheMan earned 80 total points
ID: 1438887
Prepare icons from advance. for all colors you have. just use them. it should be Graphical-dirty-job, nothing else.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

730 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