简体   繁体   English

创建带有多个复选框的MessageBox

[英]Creating a MessageBox with multiple Checkboxes

In a recent project I'm planning to allow the user to make certain configuration using a MessageBox with various CheckBoxes. 在最近的项目中,我计划允许用户使用带有各种CheckBox的MessageBox进行某些配置。 The number of these CheckBoxes is variable and depending on the amount of entries the User made beforehand, so I don't know how big of a Box I need and how many CheckBoxes there will be inside it. 这些CheckBox的数量是可变的,并且取决于用户事先输入的条目数量,因此我不知道我需要多大的Box,以及其中有多少CheckBox。
When the user is done checking and unchecking, he will press the "OK" Button and the values should be returned and saved. 用户完成检查和取消检查后,将按下“确定”按钮,并且应返回并保存值。

Multiple questions to this whole thing: 关于这件事的多个问题:
1. Is this a good/logical way to approach this whole thing? 1.这是处理整件事的好方法吗? (Having the user make yes/no configurations to an unknown amount of options) (让用户对未知数量的选项进行是/否配置)
2. How would I create a MessageBox/Pop-Up with an uncertain amount of CheckBoxes? 2.如何创建带有不确定数量的CheckBox的MessageBox /弹出窗口?
3. Is there any smart way to design that box, so that it is not to big or to small and fits every option evenly spaced? 3.是否有任何聪明的方法来设计该盒子,以使它不会太大或太小而无法适合每个选项的均匀分布?

  1. Is this a good/logical way to approach this whole thing? 这是处理整件事的好方法吗? (Having the user make yes/no configurations to an unknown amount of options) (让用户对未知数量的选项进行是/否配置)

Yes, what else could u do if the options to agree with depend on previous settings. 是的,如果要同意的选项取决于以前的设置,您还能做什么? So yes this design is ok. 是的,这种设计还可以。

  1. How would I create a MessageBox/Pop-Up with an uncertain amount of CheckBoxes? 如何创建带有不确定数量的CheckBox的MessageBox /弹出窗口?

In general, i highly suggest to not use the standard MessageBox of the .NET Framework. 通常,我强烈建议不要使用.NET Framework的标准MessageBox I would make my own window, and place all in with an yes/no button. 我将创建自己的窗口,并使用是/否按钮将其全部放入。

  1. Is there any smart way to design that box, so that it is not to big or to small and fits every option evenly spaced? 有没有什么聪明的方法可以设计那个盒子,以免它变大或变小并不能适合每个选项的均匀分布?

Design ur window based on a Grid . 基于Grid窗口设计。 Then pick a place that can be ur viewing area. 然后选择一个可以观看的地方。 In this place add some kind of stack control ae StackPanel . 在这个地方添加某种堆栈控件,例如StackPanel Then just load dynamically ur controls into this stack and ur done. 然后只需将ur控件动态加载到此堆栈中,即可完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM