?
Solved

Drag Item in ListView

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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 Month12 days, 2 hours left to enroll

752 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