Looking for a control
-
I'm Looking for a control similar to ListBox, but it would be a little different. You would see the options that you can choose from on one side (preferably left), and then you would see what you've selected in the list on the box on the right hand side of control. You would be able to move the items back and forth by double clicking on them, or clicking on arrows that would move them. I've seen this type of control used multiple times, and so I figure it must be in the .Net framework, but I can't think of what it's called to find it. Thanks for the help.
-
I'm Looking for a control similar to ListBox, but it would be a little different. You would see the options that you can choose from on one side (preferably left), and then you would see what you've selected in the list on the box on the right hand side of control. You would be able to move the items back and forth by double clicking on them, or clicking on arrows that would move them. I've seen this type of control used multiple times, and so I figure it must be in the .Net framework, but I can't think of what it's called to find it. Thanks for the help.
No, it doesn't exist. This control, as you describe it, is made of 2 listboxes and 2 buttons, one for move left to right and one for move right to left. You can of course create your own custom control and render in it 2 listboxes and 2 buttons.
-- If this is a post that has been helpful to you, please vote for it. Thank you! "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
-
I'm Looking for a control similar to ListBox, but it would be a little different. You would see the options that you can choose from on one side (preferably left), and then you would see what you've selected in the list on the box on the right hand side of control. You would be able to move the items back and forth by double clicking on them, or clicking on arrows that would move them. I've seen this type of control used multiple times, and so I figure it must be in the .Net framework, but I can't think of what it's called to find it. Thanks for the help.
You could use the standard listbox control for this. Just create 2 list boxes, and place them side by side. have 2 buttons in the middle "->" and "<-". In the button mousedown control, check to see if something is selected in the list box. If there is, get the item in the list box, and add it to the other side. All the "magic" here is done by the buttons.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
-
I'm Looking for a control similar to ListBox, but it would be a little different. You would see the options that you can choose from on one side (preferably left), and then you would see what you've selected in the list on the box on the right hand side of control. You would be able to move the items back and forth by double clicking on them, or clicking on arrows that would move them. I've seen this type of control used multiple times, and so I figure it must be in the .Net framework, but I can't think of what it's called to find it. Thanks for the help.
Erhm, I think that selecting kind of thing is a misterious kind of cooperation between controls, events and code! You can even try this at home!! Right click your projects and choose Add > User Control Drag two listboxes on the newly create control which you named whatever you want... Place one listbox in the left, the other one aligns right, make sure to leave some space in between the boxes for some buttons... name the left listbox lstOptions, the right listbox we name lstSelection... Now place four buttons aboce eachother between those lists name the first one btnAddAll The second one btnAdd the third one btnRemove and the last one btnClearSelection Now create a function which will add a listitem to a listbox private void AddItem(ListItem Item, ListBox Box) { // Your code } then doubleclick the btnAddAll and enter the following code :
foreach (ListItem itm in lstOptions) { lstOptions.Items.Remove(itm); lstSelection.Items.Add(itm); }
Then add quite similar code behind the other buttons... You've just create your own control!!!.: I love it when a plan comes together :. http://www.zonderpunt.nl