Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extended Multi Select with ListView

Status
Not open for further replies.

RobbieD

Programmer
Mar 19, 2003
12
GB
Hi all

I'm a bit new to the .net stuff, so can someone help me. I want to use extended multiselect with a ListView control. I can do it with VB6 but now I'm a bit lost.

Cheers

Jon
 
I have that already set, but I want to select the data by a click & drag of the mouse....any thoughts
 
Could you expained on you suggestion this is how I do it in VB6, on the mousemove sub

If Button = vbLeftButton Then
lvtrades.SelectedItem = lvtrades.HitTest(X, Y)
End If

but it won't work in .net

cheers

Jon
 
make a module level Point variable.

on mouse down set the point to the mouse's position.

on mouse move find all of the list items that are displayed between the two points (the point on mouse down, and the point on mouse move). This will be the tricky part as you'll have to figure out which rows are in your selected area. a combination of row height and visiblerows may be helpful.

you can also add code so that when the mouse is towards the buttom or top of the listbox the list will scroll while selecting.

It's not the easiest thing to impliment. but it sounds like a fun project. Much more entertaining then my morning chore of debugging a 6 year old excel file :(

-Rick

----------------------
 
Cheers Rick.....while I play around with this idea, if anyone else has a way to solve my problem please join in
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top