Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对 WPF 的操作有点困惑。我可以更改按钮的文本但不能更改颜色,它给出了只读属性错误。似乎设计有问题。文本更改颜色会引发错误。
svrSmtp.Stop() btnStartServer.Background.ClearValue(Button.BackgroundProperty) btnStartServer.Content = "Start Proxy"
您想清除 Button.Background 的值,而不是它的背景属性。
btnStartServer.ClearValue (Button.BackgroundProperty);