예제 #1
0
        public static string popup_input(string title, string msg, frm_base m, string def_val = "")
        {
            frm_popup f = init(title, msg, true, false, m);

            f.input_val = def_val;
            f.input     = true;
            DialogResult r = f.ShowDialog();

            return(r == DialogResult.OK ? f.input_val : null);
        }
예제 #2
0
        public static bool popup(string title, string msg, frm_base m, out item choosed, bool error = false
                                 , List <item> items = null, bool yn = false)
        {
            choosed = null;

            frm_popup f = init(title, msg, yn || items != null, error, m);

            f.items = items;
            DialogResult r = f.ShowDialog();

            choosed = f.choosed;

            return(r == DialogResult.OK);
        }
예제 #3
0
        protected static frm_popup init(string title, string msg, bool yn, bool error, frm_base m)
        {
            frm_popup f = new frm_popup();

            f.lbl_title.Text = title.ToUpper();
            f.lbl_msg.Text   = msg;
            f.yn             = yn;

            f.lbl_title.BackColor = f.pb_close.BackColor = error ? Color.Crimson : Color.DeepSkyBlue;
            f.lbl_msg.BackColor   = error ? Color.Tomato : Color.DodgerBlue;
            f.BackColor           = error ? Color.Tomato : Color.DodgerBlue;

            f.Width = m.ClientSize.Width - 4;
            f.Left  = 2;
            return(f);
        }
예제 #4
0
 public static void popup_err(frm_base m, string msg)
 {
     popup("ERRORE", msg, m, out item choosed, true);
 }
예제 #5
0
 public static void popup_err(frm_base m, Exception ex)
 {
     popup("ERRORE", ex.Message, m, out item choosed, true);
 }