Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            if (DpiAware.GetCurrentDpi() > 96)
            {
                this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight);
            }
            this.Size         = new System.Drawing.Size(300, 300);
            this.CaptionAlign = HorizontalAlignment.Left;
            this.Text         = "Grid Pad";
            try
            {
                InitializeMenu();

                StandardStatusBar(null, null);
                statusBarPanel.BorderStyle = StatusBarPanelBorderStyle.None;
                statusBarPanel.Width       = (int)DpiAware.LogicalToDeviceUnits(500.0f);
                statusBarPanel.AutoSize    = StatusBarPanelAutoSize.Spring;

                statusBarPanel1.BorderStyle = StatusBarPanelBorderStyle.Sunken;
                statusBarPanel1.Width       = (int)DpiAware.LogicalToDeviceUnits(50.0f);
                statusBarPanel1.AutoSize    = StatusBarPanelAutoSize.None;

                statusBarPanel2.BorderStyle = StatusBarPanelBorderStyle.Sunken;
                statusBarPanel2.Width       = (int)DpiAware.LogicalToDeviceUnits(50.0f);
                statusBarPanel2.AutoSize    = StatusBarPanelAutoSize.None;
                statusBar.ShowPanels        = true;
                statusBar.Panels.Add(statusBarPanel);
                statusBar.Panels.Add(statusBarPanel1);
                statusBar.Panels.Add(statusBarPanel2);

                this.IsMdiContainer = true;
                Anchor        = ~AnchorStyles.None;
                MenuComplete += new EventHandler(StandardStatusBar);

                // set the old form start position
                this.Size = new System.Drawing.Size(1028, 591);

                GridFrame doc = new GridFrame();
                doc.MdiParent = this;
                doc.Show();
                this.Controls.Add(statusBar);
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();
            this.Size         = new System.Drawing.Size(300, 300);
            this.CaptionAlign = HorizontalAlignment.Left;
            this.Text         = "Grid Pad";
            try
            {
                InitializeMenu();

                StandardStatusBar(null, null);
                statusBarPanel.BorderStyle = StatusBarPanelBorderStyle.None;
                statusBarPanel.Width       = 500;
                statusBarPanel.AutoSize    = StatusBarPanelAutoSize.Spring;

                statusBarPanel1.BorderStyle = StatusBarPanelBorderStyle.Sunken;
                statusBarPanel1.Width       = 50;
                statusBarPanel1.AutoSize    = StatusBarPanelAutoSize.None;

                statusBarPanel2.BorderStyle = StatusBarPanelBorderStyle.Sunken;
                statusBarPanel2.Width       = 50;
                statusBarPanel2.AutoSize    = StatusBarPanelAutoSize.None;
                statusBar.ShowPanels        = true;
                statusBar.Panels.Add(statusBarPanel);
                statusBar.Panels.Add(statusBarPanel1);
                statusBar.Panels.Add(statusBarPanel2);

                this.IsMdiContainer = true;
                Anchor        = ~AnchorStyles.None;
                MenuComplete += new EventHandler(StandardStatusBar);

                // set the old form start position
                this.Size = new System.Drawing.Size(640, 480);

                GridFrame doc = new GridFrame();
                doc.MdiParent = this;
                doc.Show();
                this.Controls.Add(statusBar);
            }
            catch
            {
            }
        }