public UserControl1(MsgBoxReq msgBoxReq) { InitializeComponent(); CreateButttons(); SetImage(msgBoxReq); SetMessageBoxData(msgBoxReq); }
private void SetMessageBoxData(MsgBoxReq msgBoxReq) { this.lblTitle.Text = msgBoxReq.Caption; this.richTextBox1.Text = "this is awosom pciture."; LinkLabel link = new LinkLabel(); link.Text = "something"; link.LinkClicked += new LinkLabelLinkClickedEventHandler(this.link_LinkClicked); LinkLabel.Link data = new LinkLabel.Link(); data.LinkData = @"http://www.google.com"; link.Links.Add(data); link.AutoSize = true; link.Location = this.richTextBox1.GetPositionFromCharIndex(this.richTextBox1.TextLength); this.richTextBox1.Controls.Add(link); this.richTextBox1.AppendText(link.Text + " "); this.richTextBox1.AppendText(" after text "); this.richTextBox1.SelectionStart = this.richTextBox1.TextLength; }
private void SetImage(MsgBoxReq msgBoxReq) { switch (msgBoxReq.Image) { case ImageAction.Warning: this.pictureBox1.Image = Properties.Resources.sign_warning_icon1; break; case ImageAction.Error: this.pictureBox1.Image = Properties.Resources.Close_icon; break; case ImageAction.Info: this.pictureBox1.Image = Properties.Resources.Button_Info_icon; break; default: break; } }
public static void Show(MsgBoxReq msgBoxReq) { }