简体   繁体   English

C# Winform 复选框按钮文本

[英]C# Winform checkbox button text

I have a winform with a series of check boxes as buttons.我有一个带有一系列复选框作为按钮的 winform。

The datatype in SQL is a it SQL 中的数据类型是 it

The checkbox is bound复选框已绑定

When the value is true the text on the "button" says "True" when false it says "False"当值为真时,“按钮”上的文本显示为“真”,当为假时,它显示为“假”

I want the text to not change from what I type in.我希望文本不会与我输入的内容发生变化。

EX;前任;

Checkbox says "Unit Active?"复选框显示“单位活动?”

When true it changes to True, I want it to say Unit Active?当 true 变为 True 时,我希望它说 Unit Active? and turn green并变绿

Any suggestions?有什么建议?

TIA TIA

It looks like you are binding to the Text of the Checkbox.看起来您正在绑定到复选框的Text However, you specifically state that you don't want the text to change.但是,您明确声明不希望更改文本。

I think that you should bind to the Checked property instead.我认为你应该绑定到Checked属性。

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

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