开发者

.NET Choose Items Dialog

开发者 https://www.devze.com 2023-01-13 12:00 出处:网络
Is there a standard .NET control for what I call \"a two pane picker\", or do I have to code it by hand?

Is there a standard .NET control for what I call "a two pane picker", or do I have to code it by hand?

Two pane picker:

  • The left pane has a list of items.
  • The user can pick items from the left pane to put them in the right pane using buttons between the two panes.
  • Picked items in the开发者_如何学JAVA right pane can be reordered with buttons.

An example of the "two pane picker" can be found by right clicking the Quick Access toolbar in Word 2007 and clicking "Customize Quick Access Toolbar..."

Note: If applicable, VB.NET answers preferred, but C# answers are acceptable too.


There's no standard control for that. Sounds like an excellent case for a custom user/composite control.


There are no .NET Framework controls which create the functionality you describe, however it is fairly easy to implement. Here's some examples I was able to find (not tested):

  • https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1253&lngWId=10
  • http://www.dotnetspider.com/resources/18324-Content-Transfer-between-Two-listboxes.aspx
  • http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/2082caa0-5ece-4ad8-8077-8c7170fa6f9f


There is no standard picker. You have to build it yourself or find a third party control.


I don't know of anything like that, but its trivial to implement with two ListBoxes and some buttons. When 'Add' is clicked, do .Remove with the item at the selectedIndex from the left and .Add it to the ListBox on the right.

0

精彩评论

暂无评论...
验证码 换一张
取 消