02 2013 档案

摘要:方法一:给需要添加右键菜单的控件设置ContextMenuStrip属性,如给dataGridView1添加菜单方法为:this.dataGridView1.ContextMenuStrip = this.contextMenuStrip1;这样做右键菜单自动添加,也无需设定菜单的位置,只要在控件上单击右键,即可在鼠标处弹出菜单这样做的缺点有两个:第一个,不能在控件的指定位置弹出菜单,因为有时候并不需要在控件的所有位置都弹出,例如对于DatagridView而言,可能仅仅需要在右键单击列名的时候弹出菜单;第二个,控件的click等事件无法执行,右键单击控件,并没有执行相应的事件函数而只是跳出菜 阅读全文
posted @ 2013-02-05 23:06 StrivingJee 阅读(2248) 评论(0) 推荐(0) 编辑
摘要:简例: 1 [assembly: System.Reflection.AssemblyVersion("1.2")] 2 namespace MyNamespace 3 { 4 using System; 5 using System.Windows.Forms; 6 7 8 public class MyForm :Form 9 {10 private Button btnLoad;11 private PictureBox pboxPhoto;12 public MyForm()13 {14... 阅读全文
posted @ 2013-02-05 17:28 StrivingJee 阅读(385) 评论(0) 推荐(0) 编辑
摘要:MouseButton枚举命名空间: System.Windows.Input语法:public enum MouseButton成员:Left 鼠标左按钮。Middle 鼠标中键。Right 鼠标右按钮XButton1 第一个鼠标扩展按钮XButton2 第二个鼠标扩展按钮MouseEventArgs 类命名空间: System.Windows.Input语法:public class MouseEventArgs : InputEventArgs鼠标事件(响应的时间参数均为MouseEventArgs类)事件 说明MouseDown 当鼠标指... 阅读全文
posted @ 2013-02-03 20:37 StrivingJee 阅读(2330) 评论(0) 推荐(0) 编辑