问题
In Java there's a useful class in the standard Swing libraries called 'JOptionPane' that provides a bunch of pre-made but customizable windows for displaying messages and getting (simple) user input.
I know there's 'MessageBox.Show(..)' to display Yes/No/Cancel type messages to the user in C#, but is there an equivalent class (or simple library) that provides easy-to-use customizable input boxes?
Something like the functionality available from JOptionPane is what I'm looking for.
回答1:
As of windows vista, there is the taskdialog api.
This is an os feature, not a c# library, in that sense not what you asked. But it roughly covers the same ground: a more versatile messagebox api, that relieves you from manually layouting simple dialogs. If you google, you can find c# wrappers that emulate this api on older windows.
Finally, here is a blog entry how to use it in c#
回答2:
Well, the only thing I can think of that's similar is this. It's part of Microsoft.VisualBasic.dll so you'll have to add a reference. I don't think there's any way of customizing it more than that, but that does give you a little more flexibility.
来源:https://stackoverflow.com/questions/667791/joptionpane-equivalent-in-c