CSDN博客

img runmin

重载方法调用。

发表于2004/6/23 11:40:00  683人阅读

很是郁闷不能写this(),没办法,先来个凑合用,问题,放这里,有时间解决。

 

         public Reminder( Message message, Form parent )

         {

              this.InitMember(message, parent, true);

         }

 

         public Reminder( Message message, Form parent, bool autoHide )

         {

              this.InitMember(message, parent, autoHide);

         }

 

         private void InitMember(Message message, Form parent, bool autoHide)

         {

              //

              // Required for Windows Form Designer support

              //

              InitializeComponent();

 

              //

              // TODO: Add any constructor code after InitializeComponent call

              //

              this.SMSHead.Text = message.UserPhone + "/n" + message.HappenTime;

              this.SMSContent.Text = message.Content;

 

              this.AutoHide = autoHide;

 

              this.ParentForm = parent;

         }

 

 

---------------------------------------------------------------------------

答案:

 

         public Reminder( Message message, Form parent ) : this(message, parent, true) {}

 

         public Reminder( Message message, Form parent, bool autoHide )

         {

              //

              // Required for Windows Form Designer support

              //

              InitializeComponent();

 

              //

              // TODO: Add any constructor code after InitializeComponent call

              //

              this.SMSHead.Text = message.UserPhone + "/n" + message.HappenTime;

              this.SMSContent.Text = message.Content;

 

              this.AutoHide = autoHide;

 

              this.MainWindow = parent;

         }

 

 

0 0

相关博文

我的热门文章

img
取 消
img