Exemple #1
0
        protected bool InitMainWindow()
        {
            try {
                Window = new D3DForm {
                    Text            = MainWindowCaption,
                    Name            = "D3DWndClassName",
                    FormBorderStyle = FormBorderStyle.Sizable,
                    ClientSize      = new Size(ClientWidth, ClientHeight),
                    StartPosition   = FormStartPosition.CenterScreen,
                    MyWndProc       = WndProc,
                    MinimumSize     = new Size(200, 200),
                };
                Window.MouseDown   += OnMouseDown;
                Window.MouseUp     += OnMouseUp;
                Window.MouseMove   += OnMouseMove;
                Window.MouseWheel  += OnMouseWheel;
                Window.ResizeBegin += (sender, args) => {
                    AppPaused = true;
                    Resizing  = true;
                    Timer.Stop();
                };
                Window.ResizeEnd += (sender, args) => {
                    AppPaused = false;
                    Resizing  = false;
                    Timer.Start();
                    OnResize();
                };


                Window.Show();
                Window.Update();
                return(true);
            } catch (Exception ex) {
                MessageBox.Show(ex.Message + "\n" + ex.StackTrace, "Error");
                return(false);
            }
        }
Exemple #2
0
        protected bool InitMainWindow()
        {
            try {
                Window = new D3DForm {
                    Text = MainWindowCaption,
                    Name = "D3DWndClassName",
                    FormBorderStyle = FormBorderStyle.Sizable,
                    ClientSize = new Size(ClientWidth, ClientHeight),
                    StartPosition = FormStartPosition.CenterScreen,
                    MyWndProc = WndProc,
                    MinimumSize = new Size(200, 200),

                };
                Window.MouseDown += OnMouseDown;
                Window.MouseUp += OnMouseUp;
                Window.MouseMove += OnMouseMove;
                Window.MouseWheel += OnMouseWheel;
                Window.ResizeBegin += (sender, args) => {
                    AppPaused = true;
                    Resizing = true;
                    Timer.Stop();
                };
                Window.ResizeEnd += (sender, args) => {
                    AppPaused = false;
                    Resizing = false;
                    Timer.Start();
                    OnResize();
                };

                Window.Show();
                Window.Update();
                return true;
            } catch (Exception ex) {
                MessageBox.Show(ex.Message + "\n" + ex.StackTrace, "Error");
                return false;
            }
        }