search.cs
上传用户:yan_wy
上传日期:2007-06-09
资源大小:112k
文件大小:7k
源码类别:

ICQ/即时通讯

开发平台:

C#

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. namespace qq
  7. {
  8. /// <summary>
  9. /// search 的摘要说明。
  10. /// </summary>
  11. public class search : System.Windows.Forms.Form
  12. {
  13. Form1 form;
  14. private System.Windows.Forms.TextBox textBox1;
  15. private System.Windows.Forms.TextBox textBox2;
  16. private System.Windows.Forms.TextBox textBox3;
  17. private System.Windows.Forms.Label label1;
  18. private System.Windows.Forms.Label label2;
  19. private System.Windows.Forms.Label label3;
  20. private System.Windows.Forms.RadioButton radioButton1;
  21. private System.Windows.Forms.RadioButton radioButton2;
  22. private System.Windows.Forms.GroupBox groupBox1;
  23. private System.Windows.Forms.Button button1;
  24. private System.Windows.Forms.Button button2;
  25. /// <summary>
  26. /// 必需的设计器变量。
  27. /// </summary>
  28. private System.ComponentModel.Container components = null;
  29. public search(Form1 f)
  30. {
  31. //
  32. // Windows 窗体设计器支持所必需的
  33. //
  34. form=f;
  35. InitializeComponent();
  36. //
  37. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  38. //
  39. }
  40. /// <summary>
  41. /// 清理所有正在使用的资源。
  42. /// </summary>
  43. protected override void Dispose( bool disposing )
  44. {
  45. if( disposing )
  46. {
  47. if(components != null)
  48. {
  49. components.Dispose();
  50. }
  51. }
  52. base.Dispose( disposing );
  53. }
  54. #region Windows 窗体设计器生成的代码
  55. /// <summary>
  56. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  57. /// 此方法的内容。
  58. /// </summary>
  59. private void InitializeComponent()
  60. {
  61. this.textBox1 = new System.Windows.Forms.TextBox();
  62. this.textBox2 = new System.Windows.Forms.TextBox();
  63. this.textBox3 = new System.Windows.Forms.TextBox();
  64. this.label1 = new System.Windows.Forms.Label();
  65. this.label2 = new System.Windows.Forms.Label();
  66. this.label3 = new System.Windows.Forms.Label();
  67. this.radioButton1 = new System.Windows.Forms.RadioButton();
  68. this.radioButton2 = new System.Windows.Forms.RadioButton();
  69. this.groupBox1 = new System.Windows.Forms.GroupBox();
  70. this.button1 = new System.Windows.Forms.Button();
  71. this.button2 = new System.Windows.Forms.Button();
  72. this.groupBox1.SuspendLayout();
  73. this.SuspendLayout();
  74. // 
  75. // textBox1
  76. // 
  77. this.textBox1.Location = new System.Drawing.Point(112, 32);
  78. this.textBox1.Name = "textBox1";
  79. this.textBox1.Size = new System.Drawing.Size(72, 21);
  80. this.textBox1.TabIndex = 0;
  81. this.textBox1.Text = "";
  82. // 
  83. // textBox2
  84. // 
  85. this.textBox2.Location = new System.Drawing.Point(112, 64);
  86. this.textBox2.Name = "textBox2";
  87. this.textBox2.Size = new System.Drawing.Size(72, 21);
  88. this.textBox2.TabIndex = 1;
  89. this.textBox2.Text = "";
  90. // 
  91. // textBox3
  92. // 
  93. this.textBox3.Location = new System.Drawing.Point(112, 104);
  94. this.textBox3.Name = "textBox3";
  95. this.textBox3.Size = new System.Drawing.Size(72, 21);
  96. this.textBox3.TabIndex = 2;
  97. this.textBox3.Text = "";
  98. // 
  99. // label1
  100. // 
  101. this.label1.Location = new System.Drawing.Point(56, 32);
  102. this.label1.Name = "label1";
  103. this.label1.Size = new System.Drawing.Size(40, 16);
  104. this.label1.TabIndex = 4;
  105. this.label1.Text = "QQ";
  106. this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  107. // 
  108. // label2
  109. // 
  110. this.label2.Location = new System.Drawing.Point(56, 112);
  111. this.label2.Name = "label2";
  112. this.label2.Size = new System.Drawing.Size(40, 16);
  113. this.label2.TabIndex = 5;
  114. this.label2.Text = "性别";
  115. // 
  116. // label3
  117. // 
  118. this.label3.Location = new System.Drawing.Point(56, 72);
  119. this.label3.Name = "label3";
  120. this.label3.Size = new System.Drawing.Size(40, 16);
  121. this.label3.TabIndex = 6;
  122. this.label3.Text = "昵称";
  123. // 
  124. // radioButton1
  125. // 
  126. this.radioButton1.Location = new System.Drawing.Point(80, 16);
  127. this.radioButton1.Name = "radioButton1";
  128. this.radioButton1.Size = new System.Drawing.Size(40, 24);
  129. this.radioButton1.TabIndex = 7;
  130. this.radioButton1.Text = "是";
  131. // 
  132. // radioButton2
  133. // 
  134. this.radioButton2.Location = new System.Drawing.Point(80, 40);
  135. this.radioButton2.Name = "radioButton2";
  136. this.radioButton2.Size = new System.Drawing.Size(72, 24);
  137. this.radioButton2.TabIndex = 8;
  138. this.radioButton2.Text = "否";
  139. // 
  140. // groupBox1
  141. // 
  142. this.groupBox1.Controls.Add(this.radioButton1);
  143. this.groupBox1.Controls.Add(this.radioButton2);
  144. this.groupBox1.Location = new System.Drawing.Point(48, 152);
  145. this.groupBox1.Name = "groupBox1";
  146. this.groupBox1.Size = new System.Drawing.Size(144, 72);
  147. this.groupBox1.TabIndex = 9;
  148. this.groupBox1.TabStop = false;
  149. this.groupBox1.Text = "是否在线";
  150. this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter);
  151. // 
  152. // button1
  153. // 
  154. this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
  155. this.button1.Location = new System.Drawing.Point(128, 240);
  156. this.button1.Name = "button1";
  157. this.button1.Size = new System.Drawing.Size(64, 24);
  158. this.button1.TabIndex = 10;
  159. this.button1.Text = "下一步";
  160. this.button1.Click += new System.EventHandler(this.button1_Click);
  161. // 
  162. // button2
  163. // 
  164. this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
  165. this.button2.Location = new System.Drawing.Point(24, 240);
  166. this.button2.Name = "button2";
  167. this.button2.Size = new System.Drawing.Size(64, 24);
  168. this.button2.TabIndex = 11;
  169. this.button2.Text = "取消";
  170. this.button2.Click += new System.EventHandler(this.button2_Click);
  171. // 
  172. // search
  173. // 
  174. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  175. this.ClientSize = new System.Drawing.Size(248, 277);
  176. this.Controls.Add(this.button2);
  177. this.Controls.Add(this.button1);
  178. this.Controls.Add(this.groupBox1);
  179. this.Controls.Add(this.label3);
  180. this.Controls.Add(this.label2);
  181. this.Controls.Add(this.label1);
  182. this.Controls.Add(this.textBox3);
  183. this.Controls.Add(this.textBox2);
  184. this.Controls.Add(this.textBox1);
  185. this.Name = "search";
  186. this.Text = "search";
  187. this.groupBox1.ResumeLayout(false);
  188. this.ResumeLayout(false);
  189. }
  190. #endregion
  191. public string getstring()
  192. {
  193. string a="";
  194. if(this.textBox1.Text!="")
  195. a+=("id="+this.textBox1.Text);
  196. if(this.textBox2.Text!="")
  197. a+=("name='"+this.textBox2.Text+"'");
  198. if(this.textBox3.Text!="")
  199. a+=("sex='"+this.textBox3.Text+"'");
  200. return a;
  201. }
  202. private void groupBox1_Enter(object sender, System.EventArgs e)
  203. {
  204. }
  205. private void button2_Click(object sender, System.EventArgs e)
  206. {
  207. this.Close();
  208. }
  209. private void button1_Click(object sender, System.EventArgs e)
  210. {
  211.      friend f=new friend(form);
  212. f.startset(this.getstring());
  213. f.Show();
  214. this.Close();
  215. }
  216. }
  217. }