示例#1
0
 public UserControlLoader(UserControl usercontrol, bool ChangeSizeFormBySizeOfTheUserControl_ = false, bool showMaximizeSate = false, bool AllSize_ = false, bool Pad_ = true)
 {
     try
     {
         usercontrol_ = usercontrol;
         using (D = new UI.WindowsForms.UIElements.Form())//;
         {
             D.BackColor       = Color.Black;
             D.Opacity         = 0.60f;
             D.Width           = usercontrol.Width;
             D.Height          = usercontrol.Height;
             D.WindowState     = FormWindowState.Maximized;
             showMaximizeSate_ = showMaximizeSate;
             Pad     = Pad_;
             AllSize = AllSize_;
             ChangeSizeFormBySizeOfTheUserControl = ChangeSizeFormBySizeOfTheUserControl_;
             D.Load          += D_Load;
             D.openAsShortcut = true;
             D.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
        private static Form CreateForm(UserControl usercontrol)
        {
            var D = new UI.WindowsForms.UIElements.Form();

            D.Name        = "BackForm";
            D.BackColor   = Color.Black;
            D.Opacity     = 0.60f;
            D.Width       = usercontrol.Width;
            D.Height      = usercontrol.Height;
            D.WindowState = FormWindowState.Maximized;
            D.Load       += (s, e) =>
            {
                Atiran.UI.WindowsForms.UIElements.Form frm = new Atiran.UI.WindowsForms.UIElements.Form();

                frm.KeyPreview       = true;
                frm.StartPosition    = FormStartPosition.CenterScreen;
                frm.TransparencyKey  = Color.Snow;
                frm.BackColor        = Color.Snow;
                frm.Width            = usercontrol.Width;
                frm.Height           = usercontrol.Height;
                frm.MaximumSize      = new Size(usercontrol.Width, usercontrol.Height);
                usercontrol.Location = new Point(0, 0);
                frm.WindowState      = FormWindowState.Normal;
                frm.Controls.Add(usercontrol);
                frm.ShowDialog();
                D.Hide();
            };
            D.openAsShortcut = true;
            return(D);
        }
示例#3
0
 public void  UserControlLoader(UserControl usercontrol, bool ChangeSizeFormBySizeOfTheUserControl_ = false)
 {
     try
     {
         usercontrol_  = usercontrol;
         D             = new UI.WindowsForms.UIElements.Form();
         D.BackColor   = Color.Black;
         D.Opacity     = 0.60f;
         D.WindowState = FormWindowState.Maximized;
         ChangeSizeFormBySizeOfTheUserControl = ChangeSizeFormBySizeOfTheUserControl_;
         D.Load += D_Load;
         D.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }