search.cs
资源名称:类似QQ聊天程序.rar [点击查看]
上传用户:yan_wy
上传日期:2007-06-09
资源大小:112k
文件大小:7k
源码类别:
ICQ/即时通讯
开发平台:
C#
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- namespace qq
- {
- /// <summary>
- /// search 的摘要说明。
- /// </summary>
- public class search : System.Windows.Forms.Form
- {
- Form1 form;
- private System.Windows.Forms.TextBox textBox1;
- private System.Windows.Forms.TextBox textBox2;
- private System.Windows.Forms.TextBox textBox3;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.RadioButton radioButton1;
- private System.Windows.Forms.RadioButton radioButton2;
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
- /// <summary>
- /// 必需的设计器变量。
- /// </summary>
- private System.ComponentModel.Container components = null;
- public search(Form1 f)
- {
- //
- // Windows 窗体设计器支持所必需的
- //
- form=f;
- InitializeComponent();
- //
- // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
- //
- }
- /// <summary>
- /// 清理所有正在使用的资源。
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #region Windows 窗体设计器生成的代码
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.textBox3 = new System.Windows.Forms.TextBox();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.radioButton1 = new System.Windows.Forms.RadioButton();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.groupBox1.SuspendLayout();
- this.SuspendLayout();
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(112, 32);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(72, 21);
- this.textBox1.TabIndex = 0;
- this.textBox1.Text = "";
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(112, 64);
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(72, 21);
- this.textBox2.TabIndex = 1;
- this.textBox2.Text = "";
- //
- // textBox3
- //
- this.textBox3.Location = new System.Drawing.Point(112, 104);
- this.textBox3.Name = "textBox3";
- this.textBox3.Size = new System.Drawing.Size(72, 21);
- this.textBox3.TabIndex = 2;
- this.textBox3.Text = "";
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(56, 32);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(40, 16);
- this.label1.TabIndex = 4;
- this.label1.Text = "QQ";
- this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(56, 112);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(40, 16);
- this.label2.TabIndex = 5;
- this.label2.Text = "性别";
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(56, 72);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(40, 16);
- this.label3.TabIndex = 6;
- this.label3.Text = "昵称";
- //
- // radioButton1
- //
- this.radioButton1.Location = new System.Drawing.Point(80, 16);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(40, 24);
- this.radioButton1.TabIndex = 7;
- this.radioButton1.Text = "是";
- //
- // radioButton2
- //
- this.radioButton2.Location = new System.Drawing.Point(80, 40);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(72, 24);
- this.radioButton2.TabIndex = 8;
- this.radioButton2.Text = "否";
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.radioButton1);
- this.groupBox1.Controls.Add(this.radioButton2);
- this.groupBox1.Location = new System.Drawing.Point(48, 152);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(144, 72);
- this.groupBox1.TabIndex = 9;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "是否在线";
- this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter);
- //
- // button1
- //
- this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
- this.button1.Location = new System.Drawing.Point(128, 240);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(64, 24);
- this.button1.TabIndex = 10;
- this.button1.Text = "下一步";
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // button2
- //
- this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
- this.button2.Location = new System.Drawing.Point(24, 240);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(64, 24);
- this.button2.TabIndex = 11;
- this.button2.Text = "取消";
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // search
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.ClientSize = new System.Drawing.Size(248, 277);
- this.Controls.Add(this.button2);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.groupBox1);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.textBox3);
- this.Controls.Add(this.textBox2);
- this.Controls.Add(this.textBox1);
- this.Name = "search";
- this.Text = "search";
- this.groupBox1.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- #endregion
- public string getstring()
- {
- string a="";
- if(this.textBox1.Text!="")
- a+=("id="+this.textBox1.Text);
- if(this.textBox2.Text!="")
- a+=("name='"+this.textBox2.Text+"'");
- if(this.textBox3.Text!="")
- a+=("sex='"+this.textBox3.Text+"'");
- return a;
- }
- private void groupBox1_Enter(object sender, System.EventArgs e)
- {
- }
- private void button2_Click(object sender, System.EventArgs e)
- {
- this.Close();
- }
- private void button1_Click(object sender, System.EventArgs e)
- {
- friend f=new friend(form);
- f.startset(this.getstring());
- f.Show();
- this.Close();
- }
- }
- }