摘要: privatevoidbutton3_Click(objectsender,EventArgse){ intnum1=100;intnum2=100; if(object.Equals(num1,num2)){MessageBox.Show("Equal");//输出Equal;}else{MessageBox.Show("NotEqual");} Peoplep1=newPeople();Peoplep2=newPeople(); if(object.Equals(p1,p2)){MessageBox.Show("PersonEqual&qu 阅读全文
posted @ 2013-04-15 20:26 Predator 阅读(202) 评论(0) 推荐(0) 编辑
摘要: stringname="ganquanfu";stringtemStr=name.Substring(0);intcount=Encoding.Default.GetByteCount(temStr);MessageBox.Show(count.ToString());//输出9 阅读全文
posted @ 2013-04-15 19:23 Predator 阅读(187) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Drawing; namespaceTestMyControls{///<summary>///XQ:ComboBoxTreeView///</summary>publicclassMyComboBoxTreeView:ComboBox{privateListBoxlistBox=null;//设置变量,用来保存传进来的ListBox对象的值 阅读全文
posted @ 2013-04-15 19:19 Predator 阅读(326) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms; namespaceTestMyControls{classMyButton:Button{privateconstintWM_LBUTTONDOWN=0x201;privateconstintWM_LBUTTONDBLCLK=0x203;protectedoverridevoidWndProc(refMessagem){if(m.Msg==WM_LBUTTONDOWN||m.Msg==W 阅读全文
posted @ 2013-04-15 19:16 Predator 阅读(452) 评论(0) 推荐(0) 编辑
摘要: const int WM_SYSCOMMAND = 0x112; const int SC_CLOSE = 0xF060; const int SC_MINIMIZE = 0xF020; const int SC_MAXIMIZE = 0xF030; protected override void WndProc(ref Message m) { if (m.Msg==WM_SYSCOMMAND) { if (m.WParam.ToInt32()==SC_MINIMIZE) { this.Close(); } } base.WndProc(ref m); } } 阅读全文
posted @ 2013-04-15 09:06 Predator 阅读(200) 评论(0) 推荐(0) 编辑
摘要: //抽象类继承非抽象类的使用abstract class CloseForm : Manager { public abstract void Display(); public abstract void ShowMessageBox(); public void OutPutDatas() { } } class GateHome:CloseForm { public override void Display() { Console.WriteLine("Display CloseForm"); } public override void ShowMessageBo 阅读全文
posted @ 2013-04-15 09:04 Predator 阅读(393) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;staticclassProgram{publicstaticboolIsContain(string[]str,inti){if(i==str.Length){returnfalse;}i++;if(str[i-1]=="2"){returntrue;}else{returnIsContain(str,i);}}staticvoidMain(){//BaseBbaseb=newBaseB();//baseb.MyFun();//判断字符串"1,2,34,24,56" 阅读全文
posted @ 2013-04-15 07:15 Predator 阅读(203) 评论(0) 推荐(0) 编辑