【问题标题】:Mouseclicking on radiobutton, taking action without checking the radiobutton鼠标点击单选按钮,在不检查单选按钮的情况下采取行动
【发布时间】:2014-10-31 09:49:54
【问题描述】:

我在 groupBox 中有 2 个单选按钮,我用它们来精确地告诉用户程序正在考虑什么。

[1]: ![表格][1]http://puu.sh/bo5dr/e93cb1d4c9.png

控制单选按钮的是左侧的文本框。我不希望用户直接控制单选按钮,所以我创建了一个 mouseclick 事件,并显示一个带有警告的消息框

private void radioButton271_MouseClick(object sender, MouseEventArgs e)
        {
        // says something like the radio buttons can only be changed by geometrical properties defined in the text boxes
        MessageBox.Show("A alteração da configuração geométrica de coberturas próximas de outras mais altas só pode ser realizada através das dimensões de h e b2.");

    }

我希望通过不放置radioButton271.Checked = true,它不会采取这种假设。 但无论 mouseclick 事件中没有内容,它都会检查单选按钮。

这是在其他地方改变了吗?

【问题讨论】:

    标签: c# events radio-button


    【解决方案1】:

    设置AutoCheck属性:

    radioButton271.AutoCheck = false;
    

    【讨论】:

      猜你喜欢
      • 2012-01-19
      • 2019-06-28
      • 1970-01-01
      • 2013-07-15
      • 2012-01-12
      • 2015-10-02
      • 1970-01-01
      相关资源
      最近更新 更多