Solved

Drag Item in ListView

Posted on 2000-03-13
2
401 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

679 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