Solved

Drag Item in ListView

Posted on 2000-03-13
2
396 Views
Last Modified: 2008-02-20
VB6,
Listview, Icon mode, set ListView.Picture.

Question 1:
When I drag a Item in listview,
the  ListItem(i).Left and ListItem(i).top can be <0 or very large.
I do not want it <0 or very large.
How can I do that?
How to let the item can only be drag
in the size of ListView.
Question 2:
If the ListView.Picture is larger than
the ListView'size, how to display the
picture in the size of Listview only.
0
Comment
Question by:hxb
2 Comments
 
LVL 3

Accepted Solution

by:
paulstamp earned 100 total points
ID: 2615003
Here are a couple of suggestions that ought to get you on your way :

To restrict dragging to within your control you need to use APIs to limit the cursor movement until the drag is complete. This article should help you with that :
http://www.mvps.org/vbnet/code/helpers/clipcursor.htm

The second part of the question about scaling the picture - create two picture boxes - one (picTarget) the size of the listview, the other the size of the picture itself (picSource). Put your source picture into the second picture box and use the paintpicture method of picSource to copy and scale the image :

picSource.PaintPicture (pictarget.picture,0,0, picSource.scalewidth, picSource.Scaleheight)

Then set Listview1 = picSource.picture.


Hope these point you in the right direction
0
 

Author Comment

by:hxb
ID: 2706251
thank
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now