Drag ' n ' Drop from Listview to Panel
Posted on 2004-11-22
I am currently building an application that allows the user to set up the dimensions of a room, then add pieces of funiture to the room (all to scale).
I was wanting to use the listview control for showing the furniture items, and a panel control is used as a 'snap grid' room.
Now the icons in the listview are not the same ones to be dragged onto the panel. What I would like to be able to do is either drag n drop the correctly scaled piece of furniture onto the panel, or have it appear on the panel when selected( much like a Real time strategy game). The user can then position it, rotate etc as needed.
Background out of the way, how do I select the right size graphic when I click on the listview, display it for dragging and drop it onto the panel. I have only 3 ratios to work with (1:1, 7:10, 1:2), which is determined when the room dimensions are chosen. May initial thoughts is to just build graphics in all 3 dimensions and stick them in a imagelist, on selection choose the correct sized graphic and then create a picturebox on the panel to stick it in. Sounds okay in theory, but VB.NET is not VB6, which is where I'm falling down. Any help is appreciated.