?
Solved

Drag Item in ListView

Posted on 2000-03-13
2
Medium Priority
?
410 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 200 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

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!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

807 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