Public partial class ToastForm: Form {// <summary> // display millisecond // </summary> private int _ wait_ms = 1000; public ToastForm (double seconds, string text, Form parent): this (seconds, text, parent, Color. blue, 15, ContentAlignment. topCenter) {} public ToastForm (double seconds, string text, Form parent, int font_size): this (seconds, text, parent, Color. blue, font_size, ContentAlignment. topCenter ){} Public ToastForm (double seconds, string text, Form parent, Color text_color, int font_size, ContentAlignment textAlignment) {InitializeComponent (); _ wait_ms = (int) (seconds * 1000 ); if (font_size! = LbShow. font. size) lbShow. font = new Font (lbShow. font. name, font_size, lbShow. font. style); lbShow. text = text; if (lbShow. textAlign! = TextAlignment) lbShow. textAlign = textAlignment; this. lbShow. foreColor = text_color; this. left = parent. left + (parent. width-this. width)/2; this. top = parent. top + (parent. height-this. height)/2;} private void ToastForm_Load (object sender, EventArgs e) {Thread t = new Thread (ThreadStart) delegate {Thread. sleep (_ wait_ms); try {this. invoke (new EventHandler (s1, e1) => this. close ();} catch {}}); t. isBackground = true; t. start ();}}