NetBlog主题

DevExpress ComboBoxEdit应用
DevExpress

DevExpress ComboBoxEdit应用

905 0

2019-09-18 更新1、给ComboBoxEdit添加itemsstring[] portName=new string[]{"COM1","COM2"}; ComboBoxEdit1.Properties.Items.AddRange(portName);2、只能选择不能在里面 输入数据 combboxEdit.propoties.textEditStyle=DisableTextEditor

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

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

4646 0

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

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

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

1833 0

以下是核心代码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确认窗口关闭

2683 0

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文件

5686 1

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关闭登录窗口打开主窗口的方法

2873 0

Program.cs中代码: Form1 fl = new Form1();fl.ShowDialog();if (fl.DialogResult == DialogResult.OK){Application.Run(new Form4());}else{return;}在登录窗体(Form1)中代码:private void button1_Click(object sender, EventArgs e) {if (textBox1.Text == "aaa&q…