gpt4 book ai didi

c# - DialogResult.Ok 就像自定义类

转载 作者:太空宇宙 更新时间:2023-11-03 21:53:42 25 4
gpt4 key购买 nike

我正在尝试开发一个自定义输入对话框。在它的构造函数中,我想采用如下参数-

PromptType.Question
PromptType.Information
PromptType.Feedback
//etc....

private void buttonTest_Click(object sender, System.EventArgs e)
{
InputBoxResult result = InputBox.Show("Some title",PromptType.Question);
}

我该怎么做?

最佳答案

你想要的是一个枚举:

public enum PromtType
{
Question,
Information,
Feedback
}

public class InputBox
{
public static void Show(PromtType type)
{
//...
}
}

InputBox.Show(PromtType.Question);

关于c# - DialogResult.Ok 就像自定义类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13276587/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com