上一页 1 2 3 4 5 6 7 8 ··· 15 下一页

2023年2月23日

WPF BackSpace 回退到上一个页面

摘要: 在Wpf程序中,有时候点击到某些控件后,再按下【BackSpace】键,画面会回到上一个 TextBox可能自己处理了,所以没有这一个现象。 解决方案是: 在App.xaml.cs 的 InitializeComponent()或OnStartup中添加如下代码: // 禁用Backspace快捷键 阅读全文

posted @ 2023-02-23 15:33 wu.g.q 阅读(277) 评论(0) 推荐(0)

2022年12月15日

wpf DataGrid cell 背景色修改参考

摘要: <DataTemplate.Triggers> <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="True"> <Sett 阅读全文

posted @ 2022-12-15 16:16 wu.g.q 阅读(392) 评论(0) 推荐(0)

wpf 自定义Messagebox时,对话框显示不居中问题

摘要: 在自定义Messagebox(有属性Window.SizeToContent="WidthAndHeight")时,对话框显示不居中,经过尝试,应设置如下: msgBox.WindowStartupLocation = WindowStartupLocation.Manual; 在显示的时候用以下函 阅读全文

posted @ 2022-12-15 10:00 wu.g.q 阅读(501) 评论(0) 推荐(0)

2022年12月7日

wpf 查找指定类型的子元素

摘要: public List<T> GetChildObjects<T>(DependencyObject obj, Type typename) where T : FrameworkElement { DependencyObject child = null; List<T> childList = 阅读全文

posted @ 2022-12-07 17:23 wu.g.q 阅读(69) 评论(0) 推荐(0)

2022年12月5日

wpf DataGrid相关总结

摘要: 1.去掉外边蓝框,设置BorderThickness="0" 阅读全文

posted @ 2022-12-05 12:02 wu.g.q 阅读(43) 评论(0) 推荐(0)

C# DataGrid嵌套DataGrid动态隐藏显示行

摘要: 前端代码: <Window x:Class="DataGridPractice.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsof 阅读全文

posted @ 2022-12-05 11:50 wu.g.q 阅读(178) 评论(0) 推荐(0)

C# RGB转Brush

摘要: C#中自定义一个Brush,使用Color赋RGB值给Brush: dataGrid2.HorizontalGridLinesBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 255, 255)); 阅读全文

posted @ 2022-12-05 11:23 wu.g.q 阅读(216) 评论(0) 推荐(0)

2022年11月21日

wpf dataGrid 获取单元格,并对单元格中的对象操作

摘要: 先上图: 要求:对第一行的“选项内容举例。。。”的控件进行隐藏,如下: 前端代码: <Window x:Class="DataGridPractice.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentati 阅读全文

posted @ 2022-11-21 15:27 wu.g.q 阅读(978) 评论(0) 推荐(0)

2022年11月7日

WPF中获取主窗口 MainWindow 实例,以及在其他窗口中获取 MainWinodw 中的控件

摘要: var _mainWindow = Application.Current.Windows .Cast<Window>() .FirstOrDefault(window => window is MainWindow) as MainWindow; 阅读全文

posted @ 2022-11-07 18:01 wu.g.q 阅读(368) 评论(0) 推荐(0)

wpf 解决画图模糊或抗锯齿以及文字模糊或抗锯齿问题

摘要: 解决方案中使用的.Net FrameWork版本:4.6.1 画图模糊或抗锯齿: 控件属性加入 SnapsToDevicePixels="True" 文字模糊或抗锯齿: 控件属性加入 TextOptions.TextFormattingMode ="Display" 阅读全文

posted @ 2022-11-07 14:31 wu.g.q 阅读(723) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 ··· 15 下一页

导航