Solved

Drag Item in ListView

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

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

691 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