JOptionPane equivalent in C#?

廉价感情. 提交于 2019-12-10 22:26:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!