Solved

TreeView DragIcon Huge

Posted on 2004-08-07
4
227 Views
Last Modified: 2008-02-01
In VB project using TreeView control and imlTreeViewIcons ImageList, I do

tvTreeView.DragIcon = imlTreeViewIcons.ListImages(5).ExtractIcon

in the MouseMove event. The icon 5 in the ImageList is size 16, colors 16. When dragging, the dragicon appears really HUGE.
How can I have it displayed at its normal size (16x16 pixels)?

(using CreateDragImage is not really an option because I need to change the DragIcon repeatedly in DragOver)

0
Comment
Question by:campinas
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
DarkoLord earned 500 total points
ID: 11745806
I have never found a proper solution to this but there are two others that may be of help:

- draw 16x16 images in a 32x32 bitmap and make the outer edge transparent
- create a separate 32x32 imagelist and populate it with the same icons.. then set the DragIcon property to the icon from 32x32 imagelist

good luck!
Darko
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11745816
Hi again,
I think I found the right one on the Brad Martinez's site:

http://www.mvps.org/btmtz/treeview/tvdragdrop.zip

Darko
0
 

Author Comment

by:campinas
ID: 11745960
Oh, that's great! Thank you so very much. Your answer is worth 5000 points,  not 500.
My best regards to you.
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11745963
You're welcome!

Darko
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB error "Type mismatch" 2 54
How to debug this code 7 61
How to incorporate an error traping routing to existing code in VB6 11 40
vbModal 12 51
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

770 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