WinForm基本控件的用法
2010-07-16 16:17
204 查看
1.ListBox 控件
方法:add();向Items里面添加值ListBox1.Items.ADD();
AddRange():向Items添加一个数组ListBox1.Items.AddRange(new string[] {"111","222"});
clear(): 清空ListBox1里面的值 ListBox1.Items.Clear();
SetSelected("索引",bool true|false),是否选中。
count 获取总数
this.listBox1.Items[index],获取里面的值index为索引(从0开始的)
this.ListBox1.Selectedindex 选中值的索引
this.ListBox1.SelectedValue 选中的值
this.ListBox1.SelectedItem
this.ListBox1.SelectedItems[index]
2.picturebox 重要的属性就是image
this.pictureBox1.Image = Image.FromFile(Application.StartupPath+@"/1.jpg");
只能通过Image中的静态方法来实现,因为Image是个抽象类。Application.StartupPath:是可执行程序的路径.
3.设置一个窗体为MDI窗体
this.IsMdiContainer = true;
怎么把子窗体加载进来
Son s1 = new Son();//实例一个对象
s1.MdiParent = this;//指定他MDI容器为当前对象
s1.Show();//显示子窗体。
4.MenuStrip 做菜单栏。
5.statustrip地址栏
方法:add();向Items里面添加值ListBox1.Items.ADD();
AddRange():向Items添加一个数组ListBox1.Items.AddRange(new string[] {"111","222"});
clear(): 清空ListBox1里面的值 ListBox1.Items.Clear();
SetSelected("索引",bool true|false),是否选中。
count 获取总数
this.listBox1.Items[index],获取里面的值index为索引(从0开始的)
this.ListBox1.Selectedindex 选中值的索引
this.ListBox1.SelectedValue 选中的值
this.ListBox1.SelectedItem
this.ListBox1.SelectedItems[index]
2.picturebox 重要的属性就是image
this.pictureBox1.Image = Image.FromFile(Application.StartupPath+@"/1.jpg");
只能通过Image中的静态方法来实现,因为Image是个抽象类。Application.StartupPath:是可执行程序的路径.
3.设置一个窗体为MDI窗体
this.IsMdiContainer = true;
怎么把子窗体加载进来
Son s1 = new Son();//实例一个对象
s1.MdiParent = this;//指定他MDI容器为当前对象
s1.Show();//显示子窗体。
4.MenuStrip 做菜单栏。
5.statustrip地址栏
相关文章推荐
- 加载控件基本用法
- 跟我学JAVA(2)--基本控件的用法
- winforms中ListView控件基本用法
- 网页基本控件的用法
- 一个WinForm记事本程序(包含主/下拉/弹出菜单/打开文件/保存文件/打印/页面设置/字体/颜色对话框/剪切版操作等等控件用法以及记事本菜单事件/按键事件的具体代码)
- Android ListView控件基本用法
- MFC基本常用控件基本用法
- 地图控件的基本用法
- c#服务器验证控件基本用法
- Android ListView控件基本用法
- mfc基本控件用法
- DevE控件chartControl 基本用法
- 树状控件的基本用法
- RecyclerView的基本用法 (一个控件实现ListView, GridView等效果)+接口回调点击事件
- 材料设计控件的基本用法
- Android ListView控件基本用法 (转载)
- WPF从我炫系统5---基本控件的用法
- 基本常用控件基本用法
- ASP.NET验证控件使用详解,介绍了基本属性和用法
- AspNetPager控件的最基本用法