随笔分类 - WinForms
摘要:KeyPress:非控制按键 KeyDown:按键按下触发 KeyUp:按键弹起触发 事件不触发时,尝试:
阅读全文
摘要:加载初始网页 加载初始html 或 加载pdf文件 在html中嵌入pdf
阅读全文
摘要:private void button1_Click(object sender, EventArgs e) { panel1.Controls.Clear(); WebBrowser wb = new WebBrowser(); wb.Dock = DockStyle.Fill; panel1.C
阅读全文
摘要:1.创建窗体对象 属性要设置为public。 2.不创建窗体对象 调用:
阅读全文
摘要:If you want to preview pdf in the winform, you need to make sure Adobe PDF Reader is installed on your computer. Then you can add control "Adobe PDF R
阅读全文
摘要:1.Control.Invoke Invoke 会导致线程的阻塞,但是是顺序执行的, 2.Control.BeginInvoke BeginInvoke 同样会导致线程的阻塞,在执行完主线程(UI线程)后才会执行, 若想要在线程执行结束之前执行 BeginInvoke,可以使用 EndInvoke,
阅读全文
摘要:1.System.Windows.Forms.Timer 直接从 Toolbox 中拖拽 Timer 控件到 Form 上,设置其属性及 Tick 事件, System.Windows.Forms.Timer 中的频率不准确,且和 UI 处于同一线程,易造成假死,但较为方便。 2.System.Ti
阅读全文
摘要:Result: Pen的属性主要有: Color(颜色),DashCap(短划线终点形状),DashStyle(虚线样式),EndCap(线尾形状), StartCap(线头形状),Width(粗细)等。 Result: 下面简单实现一下Brush的使用, Result: 下面实现对坐标轴的变换,默
阅读全文
摘要:The button "Insert" on the PC's keyboard can switch the input mode, insert and overtype. Here implement the mode "overtype" in MaskedTextBox. When usi
阅读全文
摘要:A,a 字母与数字 # 数字"0-9",空格,"+-" 9 数字"0-9",空格 0 数字"0-9"(空格也可以?) L,? 字母(有区别,未找出) &,C 任意字符(有区别,未找出) . 小数点占位符 , 千分位占位符 : 时间分隔符 / 日期分隔符 $ 货币符号 < 后续字符转为小写 > 后续字
阅读全文
摘要:Here is a demo, private void Form1_Load(object sender, EventArgs e) { chart1.Titles.Add("New Title"); chart1.ChartAreas[0].Axes[0].MajorGrid.Enabled =
阅读全文
摘要:Use chart to show stock chart void createchart() { // Create a chart and specify its location. chart1.Series.Clear(); chart1.ChartAreas.Clear(); chart
阅读全文
摘要:使用控件 BackgroundWorker 的实质是为该进程新创建一个线程来执行耗时操作。 与直接创建一个线程相比,BackgroundWorker 不需要忽视控件多线程的安全机制,详见解决界面卡死的问题。 还可以使用 BackgroundWorker 异步创建新的窗口:
阅读全文
摘要:After executing ShowDialog(), the following code will not be executed before closing the child window.
阅读全文
摘要:In order to solve this problems, you can try the following steps. 1.Create a usercontrol and add some controls. First, right click on the project name
阅读全文
摘要:Here is the demo code. public Form1() { InitializeComponent(); view.viewName = "A"; view.cameraName = "B"; view.imageSize = "10"; view.frameRate = 12;
阅读全文
摘要:The entry point of a Winform program is the method "Main". There is always a "Main" method in a winform program, and the default location of the "Main
阅读全文