12 2021 档案
摘要:经过研究发现虚拟网卡应该是没有默认网关的,而且虚拟网卡的mac地址也有规律,所以根据默认网关和mac地址来进行判断是否为虚拟网卡 public static List<string> GetLocalIP() { List<string> IpList = new List<string>(); L
阅读全文
摘要:nuget包中引用HandyControl 在主窗体中引入xmlns:hc="https://handyorg.github.io/handycontrol" 在主窗体中加入代码 <Window.Resources> <ContextMenu x:Key="ContextMenu"> <MenuIt
阅读全文
摘要:在项目文件中添加 <Target Name="AfterResolveReferences"> <ItemGroup> <EmbeddedResource Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPat
阅读全文
摘要:首先在window窗体中设置属性ResizeMode="NoResize" 然后这个时候还可以在任务管理器中对程序进行最大化最小化 当触发最大化最小化事件时,进行拦截 前台代码 StateChanged="window_StateChanged" 后台代码 private void window_S
阅读全文
摘要:效果: <Window x:Class="WpfApp65.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winf
阅读全文
摘要:private bool HasScrollbar(TextBox TextBox) { bool HasScrollbar = false; List<Grid> list = FindVisualChild<Grid>(TextBox); foreach (var item in list) {
阅读全文
摘要:private void InsertText(RichTextBox tb, string text) { tb.CaretPosition.InsertTextInRun(text); if (tb.CaretPosition.LogicalDirection == LogicalDirecti
阅读全文
摘要:前台 <Window x:Class="hittest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/
阅读全文