NetBlog主题

DevExpress ComboBoxEdit应用
DevExpress

DevExpress ComboBoxEdit应用

2747

2021-07-14 更新1、给ComboBoxEdit添加items string[] portName=new string[]{"COM1","COM2"};ComboBoxEdit1.Properties.Items.AddRange(portName);2、只能选择不能在里面 输入数据combboxEdit.propoties.textEditStyle=DisableTextEditor3、显示值与实际值(键值对模块) /…

C# WinForm tableLayoutPanel合并行和列 去掉凸出线
WinForm技巧

C# WinForm tableLayoutPanel合并行和列 去掉凸出线

12165

先看一下效果图(原创来自http://www.luofenming.com/show.aspx?id=ART2018111500001转载请保留此连接)把TableLayoutPanel拖到窗体上,然后再拖一个Panel,把panel放到TableLayoutPanel的单元格中,选中Panel,看看属性框中,是不是有了ColumnSpan和RowSpan 我在这里选择的3…

Winform遍历所有控件,以及获取控件名称和类型
WinForm技巧

Winform遍历所有控件,以及获取控件名称和类型

5291

以下是核心代码private void button4_Click(object sender, EventArgs e){Control.ControlCollection sonControls = panel1.Controls;//遍历所有控件 foreach (Control control in sonControls){string s = control.Name;//获得控件名称string s2 = control.GetType().ToStri…

C#,Winform确认窗口关闭
WinForm技巧

C#,Winform确认窗口关闭

5437

private void MainFrm_FormClosing(object sender, FormClosingEventArgs e){if (MessageBox.Show("您确认退出吗?", "www.luofenming.com", MessageBoxButtons.YesNoCancel) == System.Windows.Forms.DialogResult.Yes){Dispose();Application.Exit();}e…

C#  两种方法创建XML文件
C#基础

C# 两种方法创建XML文件

8291

using System; using System.Collections.Generic; using System.Windows.Forms; using System.Xml; using System.Xml.Linq;namespace XML文件创建 {public partial class Form1 : Form{public Form1(){InitializeComponent();}List<Penson> list = new List<Penson&…

C#,Winform关闭登入窗口打开主窗口的方法
WinForm技巧

C#,Winform关闭登入窗口打开主窗口的方法

5992

相关的视频教程 https://www.bilibili.com/video/BV1Sw411R7HXProgram.cs中代码:static class Program{/// summary/// 应用程序的主入口点。/// /summary[STAThread]static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefaul…