随笔分类 -  WinForms

摘要:To achieve this requirement, you need to create a "connectionstring" to connect them. Here is a simple demo that read data to "DataGridView". Properti 阅读全文
posted @ 2019-01-28 14:02 Kyle0418 阅读(218) 评论(0) 推荐(0)
摘要:[DllImport("uxtheme.dll", EntryPoint = "#95")] public static extern uint GetImmersiveColorFromColorSetEx(uint dwImmersiveColorSet, uint dwImmersiveCol 阅读全文
posted @ 2019-01-21 16:24 Kyle0418 阅读(697) 评论(0) 推荐(0)
摘要:设置无边框 Form: 通过重写 WndProc 实现无边框窗体的拖动: 阅读全文
posted @ 2019-01-21 16:19 Kyle0418 阅读(705) 评论(3) 推荐(1)
摘要:private void button1_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Title = "C# Corner Ope 阅读全文
posted @ 2019-01-17 17:07 Kyle0418 阅读(9614) 评论(0) 推荐(2)
摘要:有两种调用方式,在使用之前都将控件“ElementHost”添加到 Form 中: 方式一: 直接声明wpf中控件(使用 Windows.Controls) 方式二: 首先新建一个 ”User Control“, 之后,如下编辑“UserControl1.xaml”中的内容: 最后,修改”Form1 阅读全文
posted @ 2019-01-09 16:48 Kyle0418 阅读(6636) 评论(0) 推荐(0)
摘要:First, you need to add "NHunspell" from "NuGet" and import it. The specific operation is as follows: Right click the Reference and select "Manage NuGe 阅读全文
posted @ 2019-01-09 16:32 Kyle0418 阅读(630) 评论(3) 推荐(0)
摘要:下面的例子实现定时删除文件: 使用前需要从 NuGet 获取 FluentScheduler 并引用它。 阅读全文
posted @ 2019-01-07 14:53 Kyle0418 阅读(2602) 评论(0) 推荐(0)
摘要:static void SetWebBrowserFeatures(int ieVersion) { // don't change the registry if running in-proc inside Visual Studio if (LicenseManager.UsageMode ! 阅读全文
posted @ 2019-01-02 10:56 Kyle0418 阅读(1475) 评论(0) 推荐(0)
摘要:VS 提供了一种简单的方式来为应用设置多种语言——resx文件。下面演示具体的操作步骤。 1.首先新建 Winform 项目,向其添加控件,并命名 2.将 Form1 的 Localizable 属性设为 true, 设置该属性后,.net 将根据不同的语言,为应用程序生成不同的资源文件(resx文 阅读全文
posted @ 2018-12-25 13:19 Kyle0418 阅读(861) 评论(0) 推荐(0)
摘要:Parent.cs: Child.cs: 阅读全文
posted @ 2018-12-20 16:54 Kyle0418 阅读(301) 评论(0) 推荐(0)
摘要:public partial class Form1 : Form { [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern bool RegisterHotKey( IntPtr hWnd, / 阅读全文
posted @ 2018-12-18 09:47 Kyle0418 阅读(430) 评论(0) 推荐(0)
摘要:解决方案:(其中 TopMost = true 便可使窗口保持最前端) 阅读全文
posted @ 2018-12-14 17:07 Kyle0418 阅读(1042) 评论(0) 推荐(0)
摘要:方法:重写 CreateParams 测试: 阅读全文
posted @ 2018-12-13 14:10 Kyle0418 阅读(181) 评论(0) 推荐(1)
摘要:To achieve the requirement, you can refer to the following steps: 1.Click "Project" and choose "Setting Properties…", then choose "Settings". 2.Add ne 阅读全文
posted @ 2018-12-12 16:59 Kyle0418 阅读(891) 评论(0) 推荐(0)
摘要:置底前: 添加以下代码: 置底后: 阅读全文
posted @ 2018-12-11 17:02 Kyle0418 阅读(458) 评论(0) 推荐(0)
摘要:int index = richTextBox1.GetFirstCharIndexOfCurrentLine(); int line = richTextBox1.GetLineFromCharIndex(index); 阅读全文
posted @ 2018-11-29 15:50 Kyle0418 阅读(331) 评论(0) 推荐(0)
摘要:public class Form1 { //计数变量,说明输出了第N个Button private int count = 1; private void Form1_Load(System.Object sender, System.EventArgs e) { //窗体自身支持接受拖拽来的控件 阅读全文
posted @ 2018-11-27 15:32 Kyle0418 阅读(284) 评论(0) 推荐(1)
摘要:Form1(MDIParent) public partial class Form1 : Form { public interface ITools { ToolStrip CipherToolStrip { get; } } public Form1() { InitializeCompone 阅读全文
posted @ 2018-11-26 15:33 Kyle0418 阅读(420) 评论(5) 推荐(0)
摘要:将 Form 的 AutoScaleMode 属性设置为 Dpi: 在 Program.cs 中添加以下代码: 阅读全文
posted @ 2018-11-22 15:11 Kyle0418 阅读(2855) 评论(0) 推荐(2)
摘要:public partial class Form1 : Form { public Form1() { InitializeComponent(); menuStrip1.Renderer = new MenuItemRenderer(); } private void item1ToolStri 阅读全文
posted @ 2018-11-22 15:03 Kyle0418 阅读(992) 评论(0) 推荐(0)