⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forumlist.cs

📁 c#编的CSDN离线助手
💻 CS
📖 第 1 页 / 共 2 页
字号:
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>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		private int roomid;
		private string forum;

		public ForumList()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <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>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </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("软件开发", 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技术", 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("数据库编程", new System.Windows.Forms.TreeNode[] {
																																																														 new System.Windows.Forms.TreeNode("数据库基础"),
																																																														 new System.Windows.Forms.TreeNode("PowerBuilder"),
																																																														 new System.Windows.Forms.TreeNode("数据仓库"),
																																																														 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开发", new System.Windows.Forms.TreeNode[] {
																																																														 new System.Windows.Forms.TreeNode("安全技术"),
																																																														 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("软件创业")}),
																																									  new System.Windows.Forms.TreeNode("操作系统", 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("扩充话题", 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)
			{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -