?? post.cs
字號(hào):
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace CSDN
{
/// <summary>
/// Post 的摘要說(shuō)明。
/// </summary>
public class Post : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton4;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Button button3;
/// <summary>
/// 必需的設(shè)計(jì)器變量。
/// </summary>
private System.ComponentModel.Container components = null;
ArrayList selectedForumList;
private bool ok = false;
public Post()
{
//
// 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.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.label3 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button2 = new System.Windows.Forms.Button();
this.radioButton4 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.button3 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(248, 264);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "確定";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(8, 120);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(432, 136);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 70);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(40, 16);
this.label1.TabIndex = 2;
this.label1.Text = "標(biāo)題:";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(48, 64);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(392, 21);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "";
//
// radioButton1
//
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(112, 16);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(88, 24);
this.radioButton1.TabIndex = 5;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "技術(shù)性問題";
//
// radioButton2
//
this.radioButton2.Location = new System.Drawing.Point(8, 16);
this.radioButton2.Name = "radioButton2";
this.radioButton2.TabIndex = 6;
this.radioButton2.Text = "非技術(shù)性問題";
//
// label3
//
this.label3.Location = new System.Drawing.Point(288, 101);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 16);
this.label3.TabIndex = 7;
this.label3.Text = "貼子給分:";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(360, 96);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(80, 21);
this.textBox3.TabIndex = 8;
this.textBox3.Text = "20";
//
// label4
//
this.label4.Location = new System.Drawing.Point(8, 96);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(40, 16);
this.label4.TabIndex = 9;
this.label4.Text = "內(nèi)容:";
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.radioButton2,
this.radioButton1});
this.groupBox1.Location = new System.Drawing.Point(232, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(208, 48);
this.groupBox1.TabIndex = 11;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "帖子類型";
//
// groupBox2
//
this.groupBox2.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button2,
this.radioButton4,
this.radioButton3});
this.groupBox2.Location = new System.Drawing.Point(8, 8);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(216, 48);
this.groupBox2.TabIndex = 12;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "發(fā)貼方式:";
//
// button2
//
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(128, 16);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(80, 23);
this.button2.TabIndex = 2;
this.button2.Text = "論壇列表...";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// radioButton4
//
this.radioButton4.Location = new System.Drawing.Point(72, 16);
this.radioButton4.Name = "radioButton4";
this.radioButton4.Size = new System.Drawing.Size(48, 24);
this.radioButton4.TabIndex = 1;
this.radioButton4.Text = "群發(fā)";
this.radioButton4.CheckedChanged += new System.EventHandler(this.radioButton4_CheckedChanged);
//
// radioButton3
//
this.radioButton3.Checked = true;
this.radioButton3.Location = new System.Drawing.Point(16, 16);
this.radioButton3.Name = "radioButton3";
this.radioButton3.Size = new System.Drawing.Size(48, 24);
this.radioButton3.TabIndex = 0;
this.radioButton3.TabStop = true;
this.radioButton3.Text = "單發(fā)";
//
// checkBox1
//
this.checkBox1.Location = new System.Drawing.Point(192, 96);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(80, 24);
this.checkBox1.TabIndex = 13;
this.checkBox1.Text = "使用簽名";
//
// button3
//
this.button3.Location = new System.Drawing.Point(336, 264);
this.button3.Name = "button3";
this.button3.TabIndex = 14;
this.button3.Text = "取消";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// Post
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(450, 296);
this.ControlBox = false;
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button3,
this.checkBox1,
this.groupBox2,
this.groupBox1,
this.label4,
this.textBox3,
this.label3,
this.textBox2,
this.label1,
this.textBox1,
this.button1});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "Post";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "發(fā)帖";
this.Load += new System.EventHandler(this.Post_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void Post_Load(object sender, System.EventArgs e)
{
}
private void button1_Click(object sender, System.EventArgs e)
{
if(this.textBox2.Text == "")
MessageBox.Show("title not allow null");
else if(this.textBox1.Text == "")
MessageBox.Show("content not allow null");
else if(this.textBox3.Text == "")
MessageBox.Show("point no allow null");
else
{
try
{
Int32.Parse(this.textBox3.Text);
}
catch
{
MessageBox.Show("not number");
return;
}
this.ok = true;
Close();
}
}
public bool OK
{
get
{
return ok;
}
}
private void button3_Click(object sender, System.EventArgs e)
{
this.ok = false;
Close();
}
public void SetPostRange()
{
this.radioButton3.Checked = false;
this.radioButton4.Checked = true;
this.button2.Enabled = true;
this.radioButton3.Enabled = false;
}
private void radioButton4_CheckedChanged(object sender, System.EventArgs e)
{
if(this.radioButton4.Checked)
this.button2.Enabled = true;
else
this.button2.Enabled = false;
}
private void button2_Click(object sender, System.EventArgs e)
{
ForumList forumList = new ForumList();
forumList.ShowDialog();
this.selectedForumList = forumList.SelectedForumList;
}
public ArrayList SelectedForumList
{
get
{
return selectedForumList;
}
}
public int PostRange
{
get
{
if(this.radioButton3.Checked)
return 1;
else
return 2;
}
}
public int TypeState
{
get
{
if(this.radioButton1.Checked)
return 1;
else
return 0;
}
}
public string Title
{
get
{
return this.textBox2.Text;
}
}
public string Content
{
get
{
return this.textBox1.Text;
}
}
public int Point
{
get
{
return Int32.Parse(this.textBox3.Text);
}
}
public bool AddMark
{
get
{
return this.checkBox1.Checked;
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -