WinForm常用代码

  //ToolStripSplitButton是标准按钮和下拉按钮的组合,各自工作,但有联系,感觉上后者是没有向下箭头ToolStripDropDownButton;

  ToolStripDropDownButton只含有一个按钮,可以选择有没有向下箭头的标志,单击时显示关联的 ToolStripDropDown 的控件。两者均可改变箭头标志在做还是在右。

  //VS自带双缓冲

  this.SetStyle(ControlStyles.UserPaint |

  ControlStyles.AllPaintingInWmPaint |

  ControlStyles.OptimizedDoubleBuffer, true);

  //控件双缓冲

  Control.DoubleBuffered=true; //attribute modfied by Protected

  //手工双缓冲

  Bitmap bmp = new Bitmap(600, 600);

  Graphics g = Graphics.FromImage(bmp);

  g.DrawLine();

  this.CreateGraphics().DrawImage(bmp, 0, 0);//这句是关键,不能在OnPaint里画BitBmp在这里调Invalidate

  Invalidate(Rectangle)//规定区域重绘,解决闪烁的另一种方法

  ComboBox ComboBox1 = (ComboBox) sender;

  (Sender as SomeObject).Method()

  this.label1.Font = new System.Drawing.Font("微软雅黑", 72F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));

  this.label1.Font = new Font("微软雅黑", fontSize);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值