日志窗口的滚动条显示,提供一个常用的选项类处理

This commit is contained in:
hsl
2017-04-08 14:51:25 +08:00
parent 0f59f13608
commit f772624f57
3 changed files with 63 additions and 16 deletions

View File

@@ -40,5 +40,51 @@ namespace CommonLibrary
} }
/// <summary>
/// 选项类,包含了所有的标识和文本的对应关系
/// </summary>
public class BasicOptions
{
/// <summary>
/// 测试,用于生成数据状态的信息存储
/// </summary>
public static readonly List<BasicOptions> test = new List<BasicOptions>()
{
new BasicOptions(0,"测试一"),
new BasicOptions(1,"测试二"),
new BasicOptions(2,"测试三"),
};
/// <summary>
/// 实例化一个对象
/// </summary>
public BasicOptions()
{
}
/// <summary>
/// 根据信息实例化一个选项对象
/// </summary>
/// <param name="code"></param>
/// <param name="des"></param>
public BasicOptions(int code, string des)
{
IntegerCode = code;
Description = des;
}
/// <summary>
/// 整数的代号
/// </summary>
public int IntegerCode { get; set; } = 0;
/// <summary>
/// 代号描述的文本
/// </summary>
public string Description { get; set; } = string.Empty;
}
} }

View File

@@ -45,6 +45,7 @@
this.textBox1.Location = new System.Drawing.Point(12, 12); this.textBox1.Location = new System.Drawing.Point(12, 12);
this.textBox1.Multiline = true; this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBox1.Size = new System.Drawing.Size(596, 457); this.textBox1.Size = new System.Drawing.Size(596, 457);
this.textBox1.TabIndex = 0; this.textBox1.TabIndex = 0;
// //

View File

@@ -146,7 +146,7 @@
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(921, 33); this.menuStrip1.Size = new System.Drawing.Size(921, 35);
this.menuStrip1.TabIndex = 1; this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1"; this.menuStrip1.Text = "menuStrip1";
// //
@@ -159,41 +159,41 @@
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.ToolStripMenuItem.Name = "管理员ToolStripMenuItem"; this.ToolStripMenuItem.Name = "管理员ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(84, 29); this.ToolStripMenuItem.Size = new System.Drawing.Size(84, 31);
this.ToolStripMenuItem.Text = "管理员"; this.ToolStripMenuItem.Text = "管理员";
// //
// 更改公告ToolStripMenuItem // 更改公告ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "更改公告ToolStripMenuItem"; this.ToolStripMenuItem.Name = "更改公告ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
this.ToolStripMenuItem.Text = "更改公告"; this.ToolStripMenuItem.Text = "更改公告";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 日志查看ToolStripMenuItem // 日志查看ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "日志查看ToolStripMenuItem"; this.ToolStripMenuItem.Name = "日志查看ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
this.ToolStripMenuItem.Text = "日志查看"; this.ToolStripMenuItem.Text = "日志查看";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 账户管理ToolStripMenuItem // 账户管理ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "账户管理ToolStripMenuItem"; this.ToolStripMenuItem.Name = "账户管理ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
this.ToolStripMenuItem.Text = "账户管理"; this.ToolStripMenuItem.Text = "账户管理";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 远程更新ToolStripMenuItem // 远程更新ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "远程更新ToolStripMenuItem"; this.ToolStripMenuItem.Name = "远程更新ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
this.ToolStripMenuItem.Text = "远程更新"; this.ToolStripMenuItem.Text = "远程更新";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 注册账号ToolStripMenuItem // 注册账号ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "注册账号ToolStripMenuItem"; this.ToolStripMenuItem.Name = "注册账号ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
this.ToolStripMenuItem.Text = "注册账号"; this.ToolStripMenuItem.Text = "注册账号";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@@ -202,13 +202,13 @@
this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.ToolStripMenuItem.Name = "设置ToolStripMenuItem"; this.ToolStripMenuItem.Name = "设置ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(64, 29); this.ToolStripMenuItem.Size = new System.Drawing.Size(64, 31);
this.ToolStripMenuItem.Text = "设置"; this.ToolStripMenuItem.Text = "设置";
// //
// 修改密码ToolStripMenuItem // 修改密码ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "修改密码ToolStripMenuItem"; this.ToolStripMenuItem.Name = "修改密码ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(164, 32);
this.ToolStripMenuItem.Text = "修改密码"; this.ToolStripMenuItem.Text = "修改密码";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@@ -219,27 +219,27 @@
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.ToolStripMenuItem.Name = "关于ToolStripMenuItem"; this.ToolStripMenuItem.Name = "关于ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(64, 29); this.ToolStripMenuItem.Size = new System.Drawing.Size(64, 31);
this.ToolStripMenuItem.Text = "关于"; this.ToolStripMenuItem.Text = "关于";
// //
// 关于本软件ToolStripMenuItem // 关于本软件ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "关于本软件ToolStripMenuItem"; this.ToolStripMenuItem.Name = "关于本软件ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(184, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(184, 32);
this.ToolStripMenuItem.Text = "关于本软件"; this.ToolStripMenuItem.Text = "关于本软件";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 更新日志ToolStripMenuItem // 更新日志ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "更新日志ToolStripMenuItem"; this.ToolStripMenuItem.Name = "更新日志ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(184, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(184, 32);
this.ToolStripMenuItem.Text = "更新日志"; this.ToolStripMenuItem.Text = "更新日志";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 版本号说明ToolStripMenuItem // 版本号说明ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "版本号说明ToolStripMenuItem"; this.ToolStripMenuItem.Name = "版本号说明ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(184, 30); this.ToolStripMenuItem.Size = new System.Drawing.Size(184, 32);
this.ToolStripMenuItem.Text = "版本号说明"; this.ToolStripMenuItem.Text = "版本号说明";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@@ -267,9 +267,9 @@
this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Right; this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
this.panel1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panel1.Location = new System.Drawing.Point(697, 33); this.panel1.Location = new System.Drawing.Point(697, 35);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(224, 421); this.panel1.Size = new System.Drawing.Size(224, 419);
this.panel1.TabIndex = 2; this.panel1.TabIndex = 2;
// //
// label_file_count // label_file_count
@@ -342,7 +342,7 @@
this.listBox1.Location = new System.Drawing.Point(11, 183); this.listBox1.Location = new System.Drawing.Point(11, 183);
this.listBox1.Name = "listBox1"; this.listBox1.Name = "listBox1";
this.listBox1.SelectionMode = System.Windows.Forms.SelectionMode.None; this.listBox1.SelectionMode = System.Windows.Forms.SelectionMode.None;
this.listBox1.Size = new System.Drawing.Size(200, 242); this.listBox1.Size = new System.Drawing.Size(200, 225);
this.listBox1.TabIndex = 12; this.listBox1.TabIndex = 12;
// //
// label_address // label_address