随笔分类 -  WPF

摘要:解决问题 1、WPF Popup 不随着 Window 一起移动的问题 2、WPF Popup 总是显示在最前面 引用命名空间 xmlns:ctrl="clr-namespace:Micro.UI.Controls" XAML C# 阅读全文
posted @ 2019-08-13 11:59 microsoftzhcn 阅读(2229) 评论(1) 推荐(2)
摘要:使用方法: 阅读全文
posted @ 2019-08-12 11:02 microsoftzhcn 阅读(904) 评论(1) 推荐(0)
摘要:首先引用 Microsoft.Practices.Prism MVVM模式代码如下: XAML代码: 后台代码: ViewModel代码: 阅读全文
posted @ 2019-08-07 15:46 microsoftzhcn 阅读(1253) 评论(0) 推荐(0)
摘要:主要是通过一个WindowManager管理类,在window后台代码中通过WindowManager注册需要弹出的窗体类型,在ViewModel通过WindowManager的Show方法,显示出来。 WindowManager代码如下: 做一个扩展方法,将子窗体注册方法扩展到Window类型的对 阅读全文
posted @ 2019-08-07 15:43 microsoftzhcn 阅读(1178) 评论(0) 推荐(0)
摘要:web 调用本地exe 程序,传入参数https://www.cnblogs.com/anjou/p/10045177.htmlWPF常用控件样式https://www.cnblogs.com/s0611163/p/10583769.htmlWPF自定义Window窗体样式https://www.c 阅读全文
posted @ 2019-03-29 10:57 microsoftzhcn 阅读(317) 评论(0) 推荐(0)
摘要:参考官方:https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/data/data-binding-wpf 实例程序:https://files.cnblogs.com/files/sntetwt/WPFBinding.zip 1、指定绑定源 W 阅读全文
posted @ 2018-11-11 16:43 microsoftzhcn 阅读(10061) 评论(0) 推荐(0)
摘要:C# 实现代码 阅读全文
posted @ 2018-11-09 13:55 microsoftzhcn 阅读(5666) 评论(1) 推荐(0)
摘要:private void ButtonNumber_Click(object sender, RoutedEventArgs e) { Button btn = (Button)sender; string number = btn.Content.ToString(); string keyword = txtKeyword.Text; //已经存在点".... 阅读全文
posted @ 2018-11-02 18:00 microsoftzhcn 阅读(977) 评论(0) 推荐(0)
摘要:public void OpenTabTip(){ bool bt = true; Process[] processes = Process.GetProcesses(); foreach (Process p in processes) { //if (p.ProcessName.ToLower 阅读全文
posted @ 2018-04-20 10:24 microsoftzhcn 阅读(288) 评论(0) 推荐(0)
摘要:using System;using System.ServiceProcess;namespace GoShopService{ public partial class Service1 : ServiceBase { protected override void OnStart(string 阅读全文
posted @ 2018-04-20 10:23 microsoftzhcn 阅读(1366) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.ServiceProcess;using System.Configuration.Install;static class Program{ /// <summary> /// 应 阅读全文
posted @ 2018-04-20 10:21 microsoftzhcn 阅读(1379) 评论(0) 推荐(0)
摘要:mydic_ShuiFei = new Dictionary<string, string>() { {"00000336","南京市自来水公司"} };cboxJFDW.ItemsSource = mydic_ShuiFei; cboxJFDW.SelectedValuePath = "Key"; 阅读全文
posted @ 2018-04-20 10:21 microsoftzhcn 阅读(163) 评论(0) 推荐(0)
摘要:前台新建一个控件ProgressBar控件,并命名为pbDown WebRequest request = WebRequest.Create("http://files.cnblogs.com/fornet/404.rar"); WebResponse respone = request.GetR 阅读全文
posted @ 2018-04-20 10:19 microsoftzhcn 阅读(3176) 评论(0) 推荐(0)
摘要:方法一:xaml中:<控件> <控件.Background><ImageBrush ImageSource="/程序集;component/images/xxx.jpg"/></控件.Background></控件> 方法二:xx.cs中:ImageBrush ib = new ImageBrush 阅读全文
posted @ 2018-04-20 10:19 microsoftzhcn 阅读(2237) 评论(0) 推荐(0)
摘要:头部调用程序集xmlns:sys="clr-namespace:System;assembly=mscorlib"<Window.Resources><!--定义一个字符串资源--><sys:String x:Key="nameStr"> 字符串</sys:String></Window.Resou 阅读全文
posted @ 2018-04-20 10:18 microsoftzhcn 阅读(339) 评论(0) 推荐(0)
摘要:方式一、Window.Resources<Window.Resources> <Style TargetType="控件类型" x:Key="样式名"> <Setter Property="属性名" Value="属性值"/> </Style> 例如: <Style TargetType="Butt 阅读全文
posted @ 2018-04-20 10:17 microsoftzhcn 阅读(838) 评论(0) 推荐(0)
摘要:WPF编程:textbox控件文本框数据显示最后一行 TextBox控件在接收大量数据的时候,滚动条一般在最上方,如何使滚动条随着数据的接收而向下滚动呢?比如有一个TextBox'控件txbRecvData,按下面的语句就可以了:this.txbRecvData.ScrollToLines(this 阅读全文
posted @ 2017-09-01 19:25 microsoftzhcn 阅读(1439) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-08-22 17:22 microsoftzhcn 阅读(2217) 评论(0) 推荐(0)
摘要:WPF UI布局 模板总结控件可以通过ItemTemplate="{StaticResource Template}"绑定指定的模板; 数据源总结控件可以通过ItemsSource="{Binding Source={StaticResource Resource}}"绑定指定的数据源; 颜色填充< 阅读全文
posted @ 2016-12-23 00:44 microsoftzhcn 阅读(1205) 评论(0) 推荐(0)
摘要:一、安装服务 1、已管理员的身份启动CMD 2、输入 cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 回车 3、输入 InstallUtil.exe Window服务软件路径.exe 回车 二、卸载服务 1、卸载很简单,打开cmd, 直接输入 sc delete WinServiceTest便可 阅读全文
posted @ 2016-10-10 11:24 microsoftzhcn 阅读(1299) 评论(0) 推荐(0)