摘要:private bool ScanBarcodeDown() { Utility.OutputInfo(txtInfo, "下扫描枪发送读码命令"); if (Program.Config.ScanTimes <= 0) Program.Config.ScanTimes = 3; if (Progr
阅读全文
摘要:Control.Invoke()方法所执行的委托方法跟创建UI元素的线程是一个线程,也就是主线程。Control.Invoke()虽然执行了委托方法,但是并没有创建新的线程,而且从实验结果出现的先后顺序可以得知,Invoke()是同步独占式的执行, Control的Invoke和BeginInvok
阅读全文
摘要:获取全局 CPU 和内存占用 要获取到全系统中的 CPU 占用率,获取全系统中内存占用,需要首先分别创建这两者的性能计数器: // 创建对 CPU 占用百分比的性能计数器。 var cpuCounter = new PerformanceCounter("Processor", "% Process
阅读全文
摘要:Control Color设置 lblLanguage.BackColor = Control.DefaultBackColor; lblLanguage.BackColor = Color.FromKnownColor(KnownColor.Control);
阅读全文
摘要:Random ran = new Random(); PointPairList list = new PointPairList(); LineItem myCurve; this.zedGraphControl1.GraphPane.Title.Text = "动态折线图"; this.zedG
阅读全文
摘要:将picturebox放到一个panel控件里面,然后设置panel控件的ArrowScroll属性为true,再设置picturebox的SizeMode属性为AutoSize 这样当图片长或宽超出panel就会自动出现滚动条 这里需要注意的是picturebox不能选择在父容器中停靠,否则没有滚
阅读全文
摘要:<?xml version="1.0"?><configuration><startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup> <runtime> <assemblyBinding
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; namespace serial { public class ModBus { /// /// modbus状态 /...
阅读全文
摘要:在被遮盖住的控件上,右击弹出快捷菜单,然后选择“置于顶层”。
阅读全文
摘要:https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
阅读全文
摘要:Collection<int> aa = new Collection<int>(); aa.Add(1); aa.Add(2); aa.Add(3); aa.Add(1); int[] arr = new int[aa.Count]; aa.CopyTo(arr, 0); int[] bb = a
阅读全文
摘要:1)listview 控件 结合 imagelist 控件 实现类似效果. 2)添加 imagelist 控件 images 属性,点击后面的... 添加相应图片. 3)点listview,查看其属性,LargeImageList 和 SmallImageList 分别是设置大小视图的图片集合的,你
阅读全文