wpf - 在 WPF 中更改切换按钮的自定义行为

标签 wpf

我是 WPF 的新手。

改变切换按钮行为的方法是什么。
enter image description  here
enter image description here
有黑色的baground,没有边框。
是否需要使用控制模板?

最佳答案

是的,您想使用 ControlTemplate改如何ToggleButton看起来。查看 ToggleButton 的页面以及这篇文章:

Customizing the Appearance of an Existing Control by Creating a ControlTemplate

让你开始。

关于wpf - 在 WPF 中更改切换按钮的自定义行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6032385/

相关文章:

WPF 绑定(bind) StringFormat 短日期字符串

c# - 在 C# 中将鼠标光标移出屏幕

WPF:如何在 1 个绑定(bind)中使用 2 个转换器?

wpf - TemplateBinding 的限制

c# - Relaycommand ICommand.CanExecute 不触发

C# 解决方案布局 - WPF + ASP.NET Core + 共享代码

c# - 如何使用 WPF 创建六边形菜单?

c# - 将 DataGrid 列按日期排序

WPF 按钮图标被镜像,为什么?

c# - 当我使用 MVVM 模型时,如何在 WPF 中使用 WndProc?