|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
有专家说:java不是跨平台,java就是平台,这很好的定义了java的特点。有了java,你只需要等待java平台在新平台上移植。这还不错吧!只是,java不是一个平台,而是多个平台。你需要在这个java平台移植到另一个java平台。- usingSystem;usingSystem.Windows.Forms;usingSystem.Drawing;usingSystem.ComponentModel;namespaceWindowsApplication4{///<summary>///SummarydescriptionforCustomColorRadioButton.///</summary>publicclassCustomColorRadioButton:RadioButton{//FieldsprivateColorcheckColor;publicCustomColorRadioButton(){this.checkColor=this.ForeColor;this.Paint+=newPaintEventHandler(this.PaintHandler);}[Description("ThecolorusedtodisplaythecheckpaintedintheRadioButton")]publicColorCheckColor{get{returncheckColor;}set{checkColor=value;this.Invalidate();}}privatevoidPaintHandler(objectsender,PaintEventArgspe){if(this.Checked){Pointpt=newPoint();if(this.CheckAlign==ContentAlignment.BottomCenter){pt.X=(this.Width/2)-3;pt.Y=this.Height-9;}if(this.CheckAlign==ContentAlignment.BottomLeft){pt.X=4;pt.Y=this.Height-9;}if(this.CheckAlign==ContentAlignment.BottomRight){pt.X=this.Width-9;pt.Y=this.Height-9;}if(this.CheckAlign==ContentAlignment.MiddleCenter){pt.X=(this.Width/2)-3;pt.Y=(this.Height/2)-3;}if(this.CheckAlign==ContentAlignment.MiddleLeft){pt.X=4;pt.Y=(this.Height/2)-3;}if(this.CheckAlign==ContentAlignment.MiddleRight){pt.X=this.Width-9;pt.Y=(this.Height/2)-3;}if(this.CheckAlign==ContentAlignment.TopCenter){pt.X=(this.Width/2)-3;pt.Y=4;}if(this.CheckAlign==ContentAlignment.TopLeft){pt.X=4;pt.Y=4;}if(this.CheckAlign==ContentAlignment.TopRight){pt.X=this.Width-9;pt.Y=4;}DrawCheck(pe.Graphics,this.checkColor,pt);}}publicvoidDrawCheck(Graphicsg,Colorc,Pointpt){Penpen=newPen(this.checkColor);g.DrawLine(pen,pt.X,pt.Y+1,pt.X+3,pt.Y+1);g.DrawLine(pen,pt.X,pt.Y+2,pt.X+3,pt.Y+2);g.DrawLine(pen,pt.X+1,pt.Y,pt.X+1,pt.Y+3);g.DrawLine(pen,pt.X+2,pt.Y,pt.X+2,pt.Y+3);}}}
复制代码 今天去面试,被问到C#中的new关键字,看了那么多的书对new关键字还是有一定认识,回来又把new复习了一遍,发现了许多以前还不知道的细节。 |
|