?? forumlist.cs
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace CSDN
{
/// <summary>
/// ForumList 的摘要說明。
/// </summary>
public class ForumList : System.Windows.Forms.Form
{
private System.Windows.Forms.ListBox listBox2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.TreeView treeView1;
/// <summary>
/// 必需的設(shè)計(jì)器變量。
/// </summary>
private System.ComponentModel.Container components = null;
private int roomid;
private string forum;
public ForumList()
{
//
// Windows 窗體設(shè)計(jì)器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 調(diào)用后添加任何構(gòu)造函數(shù)代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.listBox2 = new System.Windows.Forms.ListBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.treeView1 = new System.Windows.Forms.TreeView();
this.SuspendLayout();
//
// listBox2
//
this.listBox2.ItemHeight = 12;
this.listBox2.Location = new System.Drawing.Point(264, 24);
this.listBox2.Name = "listBox2";
this.listBox2.Size = new System.Drawing.Size(200, 328);
this.listBox2.TabIndex = 1;
this.listBox2.DoubleClick += new System.EventHandler(this.listBox2_DoubleClick);
this.listBox2.SelectedIndexChanged += new System.EventHandler(this.listBox2_SelectedIndexChanged);
//
// button1
//
this.button1.Enabled = false;
this.button1.Location = new System.Drawing.Point(224, 80);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(32, 23);
this.button1.TabIndex = 2;
this.button1.Text = ">";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(224, 120);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(32, 23);
this.button2.TabIndex = 3;
this.button2.Text = "<";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(224, 248);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(32, 23);
this.button4.TabIndex = 5;
this.button4.Text = "<<";
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button5
//
this.button5.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button5.Location = new System.Drawing.Point(200, 368);
this.button5.Name = "button5";
this.button5.TabIndex = 6;
this.button5.Text = "確定";
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// treeView1
//
this.treeView1.ImageIndex = -1;
this.treeView1.Location = new System.Drawing.Point(16, 24);
this.treeView1.Name = "treeView1";
this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("CSDN論壇", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("軟件開發(fā)", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Visual C++"),
new System.Windows.Forms.TreeNode("Visual Basic"),
new System.Windows.Forms.TreeNode("Delphi"),
new System.Windows.Forms.TreeNode("C/C++"),
new System.Windows.Forms.TreeNode("C++ Builder"),
new System.Windows.Forms.TreeNode("ASM"),
new System.Windows.Forms.TreeNode("ActiveX/COM"),
new System.Windows.Forms.TreeNode("JAVA")}),
new System.Windows.Forms.TreeNode(".Net技術(shù)", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("C#"),
new System.Windows.Forms.TreeNode("XML/SOAP"),
new System.Windows.Forms.TreeNode(".Net Framework"),
new System.Windows.Forms.TreeNode("ADO.NET"),
new System.Windows.Forms.TreeNode("ASP.NET"),
new System.Windows.Forms.TreeNode("Web Service"),
new System.Windows.Forms.TreeNode("Web Form"),
new System.Windows.Forms.TreeNode("Windows Form"),
new System.Windows.Forms.TreeNode("VB.NET"),
new System.Windows.Forms.TreeNode("VC.NET")}),
new System.Windows.Forms.TreeNode("數(shù)據(jù)庫編程", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("數(shù)據(jù)庫基礎(chǔ)"),
new System.Windows.Forms.TreeNode("PowerBuilder"),
new System.Windows.Forms.TreeNode("數(shù)據(jù)倉庫"),
new System.Windows.Forms.TreeNode("Oracle"),
new System.Windows.Forms.TreeNode("Sybase"),
new System.Windows.Forms.TreeNode("SQL Server"),
new System.Windows.Forms.TreeNode("MySQL")}),
new System.Windows.Forms.TreeNode("Web開發(fā)", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("安全技術(shù)"),
new System.Windows.Forms.TreeNode("主頁制作"),
new System.Windows.Forms.TreeNode("ASP"),
new System.Windows.Forms.TreeNode("PHP"),
new System.Windows.Forms.TreeNode("Perl"),
new System.Windows.Forms.TreeNode("Javascript"),
new System.Windows.Forms.TreeNode("JSP"),
new System.Windows.Forms.TreeNode("IIS")}),
new System.Windows.Forms.TreeNode("軟件與管理", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("軟件工程"),
new System.Windows.Forms.TreeNode("Office使用"),
new System.Windows.Forms.TreeNode("Exchange Server"),
new System.Windows.Forms.TreeNode("軟件市場"),
new System.Windows.Forms.TreeNode("軟件使用"),
new System.Windows.Forms.TreeNode("軟件評測"),
new System.Windows.Forms.TreeNode("CMM"),
new System.Windows.Forms.TreeNode("軟件創(chuàng)業(yè)")}),
new System.Windows.Forms.TreeNode("操作系統(tǒng)", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Win9x/Me"),
new System.Windows.Forms.TreeNode("WinNT/2000/XP"),
new System.Windows.Forms.TreeNode("DOS"),
new System.Windows.Forms.TreeNode("Linux"),
new System.Windows.Forms.TreeNode("Apache")}),
new System.Windows.Forms.TreeNode("擴(kuò)充話題", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("程序人生"),
new System.Windows.Forms.TreeNode("程序員考試"),
new System.Windows.Forms.TreeNode("人才熱線"),
new System.Windows.Forms.TreeNode("建議和意見"),
new System.Windows.Forms.TreeNode("灌水樂園"),
new System.Windows.Forms.TreeNode("租房信息")})})});
this.treeView1.SelectedImageIndex = -1;
this.treeView1.Size = new System.Drawing.Size(200, 328);
this.treeView1.TabIndex = 7;
this.treeView1.DoubleClick += new System.EventHandler(this.treeView1_DoubleClick);
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
// ForumList
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(474, 400);
this.ControlBox = false;
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.treeView1,
this.button5,
this.button4,
this.button2,
this.button1,
this.listBox2});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ForumList";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Tag = System.Drawing.Color.White;
this.Text = "論壇列表";
this.ResumeLayout(false);
}
#endregion
private void button1_Click(object sender, System.EventArgs e)
{
for(int i = 0; i < this.listBox2.Items.Count; i++)
{
if(forum == this.listBox2.Items[i].ToString())
{
return;
}
}
this.listBox2.Items.Add(forum);
}
private void button5_Click(object sender, System.EventArgs e)
{
Close();
}
public int Room
{
get
{
return roomid;
}
}
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
if(e.Node.Parent != null)
{
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -