C#控件列表框
来源:互联网 发布:scsi虚拟光驱软件 编辑:程序博客网 时间:2024/06/11 14:34
namespace WindowsFormsApplication2{ partial class Form1 { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows 窗体设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.listBox1 = new System.Windows.Forms.ListBox(); this.label1 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // listBox1 // this.listBox1.FormattingEnabled = true; this.listBox1.ItemHeight = 12; this.listBox1.Location = new System.Drawing.Point(55, 103); this.listBox1.Name = "listBox1"; this.listBox1.Size = new System.Drawing.Size(140, 112); this.listBox1.TabIndex = 0; this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(223, 149); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(41, 12); this.label1.TabIndex = 1; this.label1.Text = "label1"; // // button1 // this.button1.Location = new System.Drawing.Point(328, 144); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 2; this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(456, 349); this.Controls.Add(this.button1); this.Controls.Add(this.label1); this.Controls.Add(this.listBox1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.ListBox listBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button button1; }}
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication2{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { listBox1.Text = ""; label1.Text = ""; button1.Text = "结束"; listBox1.ScrollAlwaysVisible = true; Random rand = new Random(); for (int i = 0; i < 10; i++){ listBox1.Items.Add(rand.Next(89) + 10);} } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { label1.Text = listBox1.Text; } private void button1_Click(object sender, EventArgs e) { this.Dispose(); } }}
0 0
- C#控件列表框
- C#列表控件、信息导航控件概述
- C#数据列表控件取消每列前面的框
- C# GridView 控件绑定下拉列表框及给下拉列表框设定默认值
- c#仿qq好友列表控件
- c# 用枚举绑定列表控件
- C# 绘制ComboBox控件图片列表
- 关于C#绘制qq好友列表控件
- 列表框控件
- 列表框控件(listbox)
- 列表框控件简介
- 列表框控件简介
- 列表框控件简介
- 列表框控件ListBox
- 列表框控件ListBox
- 列表框----C#窗体
- C# 列表框
- C# 下拉列表框
- redis设计思想
- 关于Android资源文件中出现百分号的问题
- Android 5.0 12大新功能详解
- HDU 4990 Reading comprehension(矩阵快速幂优化)
- CentOS、Ubuntu、Debian三个linux比较异同
- C#控件列表框
- 关于在iframe中运用zdialog出现topWin.Dialog._Array为空或者不是对象的问题和图片不显示的问题
- 游戏开发手记:数据存储
- 一定坚持
- C#获取当前应用程序所在路径及环境变量
- 需要优化的sql语句查询
- MVC已死?是时候用MOVE了
- 其实你一直在成功的旁边
- linux关于ftp查看不到文件列表的问题