随笔分类 -  .Net-WPF

WPF的知识
摘要:第一步:DataGrid添加LoadingRow="ApplicationRunLogDataGrid_LoadingRow" <DataGrid x:Name="ApplicationRunLogDataGrid" AutoGenerateColumns="False" CanUserAddRow 阅读全文
posted @ 2022-03-17 16:08 ꧁执笔小白꧂ 阅读(472) 评论(0) 推荐(0) 编辑
摘要:button样式如下: <Button.Resources> <Style TargetType="{x:Type Border}"> <Setter Property="CornerRadius" Value="3"></Setter> </Style> </Button.Resources> 阅读全文
posted @ 2022-02-21 14:50 ꧁执笔小白꧂ 阅读(427) 评论(0) 推荐(0) 编辑
摘要:CanUserAddRows属性设置为False 阅读全文
posted @ 2022-02-15 14:01 ꧁执笔小白꧂ 阅读(258) 评论(0) 推荐(0) 编辑
摘要:属性AutoGenerateColumns设置为false 阅读全文
posted @ 2022-02-15 13:58 ꧁执笔小白꧂ 阅读(292) 评论(0) 推荐(0) 编辑
摘要:一般使用: Img.Image = new BitmapImage(new Uri("/Resources/列表循环_白.png", UriKind.Relative)); 找不到时,使用: Img.ImageSource = new BitmapImage(new Uri("pack://appl 阅读全文
posted @ 2022-01-15 18:42 ꧁执笔小白꧂ 阅读(324) 评论(0) 推荐(0) 编辑
摘要:常见的有四种方案:1.资源字典2.资源文件、 我用的是资源字典。 1.做两个语言资源,如下: (1)中文资源AppResource_zh_CN.xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/p 阅读全文
posted @ 2022-01-11 17:10 ꧁执笔小白꧂ 阅读(462) 评论(1) 推荐(1) 编辑
摘要:private void CmbL_SelectionChanged(object sender, SelectionChangedEventArgs e) { string 改变后的值= e.AddedItems[1].ToString(); } 阅读全文
posted @ 2021-12-30 09:37 ꧁执笔小白꧂ 阅读(494) 评论(0) 推荐(0) 编辑
摘要:Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/TestApp;component/Resources/Test.ico")).Stream; WindowsNotifyIcon.Ic 阅读全文
posted @ 2021-12-30 00:09 ꧁执笔小白꧂ 阅读(291) 评论(0) 推荐(0) 编辑
摘要:otabItem.Foreground = System.Windows.Media.Brushes.Black; tabItem.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#300b80")) 阅读全文
posted @ 2021-12-29 14:39 ꧁执笔小白꧂ 阅读(159) 评论(0) 推荐(0) 编辑
摘要:.CornerRadius // 一般需要自定义控件模板 资源中<Setter Property="Template">标签 RadiusX="2" RadiusY="2" 阅读全文
posted @ 2021-12-25 13:52 ꧁执笔小白꧂ 阅读(213) 评论(0) 推荐(0) 编辑
摘要:1、出错代码: 1 public partial class MainWindow2 : Window 2 { 3 4 public MainWindow2() 5 { 6 InitializeComponent(); 7 // 页面初始化 8 //OnLoad(); 9 } 10 .... 11 阅读全文
posted @ 2021-12-16 22:18 ꧁执笔小白꧂ 阅读(212) 评论(0) 推荐(0) 编辑
摘要:string strID = (dgUserManage.Columns[2].GetCellContent(dgUserManage.Items[i]) as TextBlock).Text; 阅读全文
posted @ 2021-12-15 18:44 ꧁执笔小白꧂ 阅读(308) 评论(0) 推荐(0) 编辑
摘要:最新版下载地址: https://www.慧都evget.com/product/740/download 图摘自:https://blog.csdn.net/luzhangtong/article/details/81177616 DexExpress12.2.5 链接:https://pan.b 阅读全文
posted @ 2021-10-19 10:49 ꧁执笔小白꧂ 阅读(481) 评论(0) 推荐(0) 编辑
摘要:很多小伙伴对“跨线程或跨类”使用WPF或WinFrom页面的控件不太明白,奉上一段小案例供参考(下面为WPF代码,WinFrom同理): 注:在WPF或WinFrom中,UI元素只能由其主线程来操作,其他任何线程都不可以直接操作UI,可以使用Dispatcher.Invoke(同步操作)或Dispa 阅读全文
posted @ 2020-12-17 10:49 ꧁执笔小白꧂ 阅读(2374) 评论(0) 推荐(1) 编辑
摘要:WPF中的Window.ShowDialog()打开的窗口中的按钮Close()事件 我经常会使用ShowDialog().Value;这个遇到实现下面的功能时,ShowDialog()出的窗体Close()时,并不能返回值。错误代码如下: 0 AddDataWay addDataWay = new 阅读全文
posted @ 2020-11-24 14:41 ꧁执笔小白꧂ 阅读(499) 评论(0) 推荐(0) 编辑
摘要:WPF与WinForm获取单元格方式不同,需要as强制转换 单元格类型 1、WinForm string str = (string)dataGrid.Rows[0].Cells[0].Value; 2、WPF string str = (dataGrid.Columns[0].GetCellCon 阅读全文
posted @ 2020-11-20 15:53 ꧁执笔小白꧂ 阅读(120) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/qq_22033759/article/details/52338359 阅读全文
posted @ 2020-11-06 13:10 ꧁执笔小白꧂ 阅读(685) 评论(0) 推荐(0) 编辑
摘要:记录 <b:BarButtonItem Content="BarButtonIte 按钮"></dxb:BarButtonItem> <b:BarCheckItem Content="BarCheckItem复选框"></dxb:BarCheckItem> <b:BarEditItem Conten 阅读全文
posted @ 2020-10-31 10:42 ꧁执笔小白꧂ 阅读(171) 评论(0) 推荐(0) 编辑
摘要:一、借鉴: /// <summary> /// 检测进程,只能启动一个 /// </summary> static void CheckProcess() { Process currentProcess = Process.GetCurrentProcess(); foreach (Process 阅读全文
posted @ 2020-07-02 16:52 ꧁执笔小白꧂ 阅读(242) 评论(0) 推荐(0) 编辑
摘要:ObservableCollection,继承了Collection, INotifyCollectionChanged, INotifyPropertyChanged,UI更新的数据反映到后台会更新对应的UI 例:UC1ViewModel类 1 Imports System.Collections 阅读全文
posted @ 2020-02-24 17:01 ꧁执笔小白꧂ 阅读(671) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示