Пример #1
0
        public static void ShowForm(MetroForm myfrm)
        {
            var mymsm = MyFormStyles.GetStyleManager(myfrm);

            //check tagging of the form specific size.
            if (myfrm.Tag != null)
            {
                switch (myfrm.Tag.ToString().ToLower())
                {
                case "menu":    //for the menu list for short cuts.
                    myfrm.Size = MenuWindowSettings.WindowSize;
                    if (MyFormStyles.MyStyle == MetroFramework.MetroThemeStyle.Light)
                    {
                        mymsm.Theme = MetroFramework.MetroThemeStyle.Dark;
                    }
                    else
                    {
                        mymsm.Theme = MetroFramework.MetroThemeStyle.Light;
                    }
                    break;

                case "list":    //for the menu list for short cuts.
                    myfrm.Size = ListWindowSettings.WindowSize;
                    break;

                default:
                    break;
                }
            }
            myfrm.StyleManager  = mymsm;
            myfrm.StartPosition = FormStartPosition.CenterScreen;
            myfrm.ShadowType    = MetroFormShadowType.DropShadow;
            myfrm.BorderStyle   = MetroFormBorderStyle.FixedSingle;
            myfrm.Show();
        }
Пример #2
0
 public static DialogResult GetShowDialog(MetroForm myfrm)
 {
     myfrm.StyleManager  = MyFormStyles.GetStyleManager(myfrm);
     myfrm.StartPosition = FormStartPosition.CenterScreen;
     myfrm.ShadowType    = MetroFormShadowType.DropShadow;
     myfrm.BorderStyle   = MetroFormBorderStyle.FixedSingle;
     return(myfrm.ShowDialog());
 }