随笔分类 - WinForm
摘要:public static Bitmap DeepClone(this Bitmap bitmap) { Bitmap dstBitmap = null; using (MemoryStream mStream = new MemoryStream()) { BinaryFormatter bf =
阅读全文
摘要:1.把TableLayoutPanel拖到窗体上; 2.拖一个Panel,把Panel放到TableLayoutPanel的单元格中; 3.选中Panel,右键查看属性框,多出ColumnSpan和RowSpan两个属性 4.修改ColumnSpan=3(3列合并),Panel的Dock属性设置为F
阅读全文
摘要:public class IEProxySetting { public static bool UnsetProxy() { return SetProxy(null, null); } public static bool SetProxy(string strProxy) { ...
阅读全文
摘要:e.Graphics.DrawLine (绘制一条连接由坐标对指定的两个点的线条) e.Graphics.DrawString (绘制指定位置的文本字符串) e.Graphics.DrawRectangle (绘制由 System.Drawing.Rectangle 结构指定的矩形(通常为边框))
阅读全文
摘要:一、IList 现在我们直接创建一个List集合,然后绑定 二、Dictionary 不能直接绑定,需要借助类BindingSource才可以完成绑定 三、数据集 取值:
阅读全文
摘要:public class CloseForm { [DllImport("user32", EntryPoint = "FindWindow")] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("us...
阅读全文
摘要:在窗体Form2中定义公有属性Form2Value,获取和设置textBox1的文本值 并且还定义一个accept事件 public string Form2Value { get { return this.textBox1.Text; } set { this.textBox1.Tex...
阅读全文
摘要:1.设置WinForm窗体属性showinTask=false 2.加notifyicon控件notifyIcon1,为控件notifyIcon1的属性Icon添加一个icon图标。 3.添加窗体最小化事件(首先需要添加事件引用): this.SizeChanged += new System.Ev
阅读全文
摘要://System.Environment.Exit(0); //Process.GetCurrentProcess().Kill(); //System.Threading.Thread.CurrentThread.Abort(); System.Diagnostics.Process.GetCurrentProcess().Kill(); Application.Exi...
阅读全文
摘要:窗体FormBorderStyle属性设置为:FixedSingle,再把最大化禁用就可以了
阅读全文
摘要:private void lt_log_MouseClick(object sender, MouseEventArgs e) { Clipboard.SetDataObject(lt_log.SelectedItem.ToString()); }
阅读全文
摘要:if (MessageBox.Show("你确定要退出程序吗?", "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK) { //... }
阅读全文
摘要:C#中一个RichTextBox,当新写入内容时,超过当前显示区域后,自动滚动到最低端,方便查看内容。
阅读全文

浙公网安备 33010602011771号