示例#1
0
 /// <summary>
 /// Processes key up events.
 /// </summary>
 private void FullScreenDialog_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (Keys.Escape == e.KeyCode)
     {
         Close();
     }
     else if (Keys.F1 == e.KeyCode && dialogSample.IsDisposed)
     {
         dialogSample = new DialogSampleForm(); // Create a new dialog window.
         this.AddOwnedForm(dialogSample);       // Add the dialog as a child to this form.
         dialogSample.TopMost = true;           // Makes the window stay on top of everything else.
         dialogSample.Show();                   // Display the dialog.
     }
 }
示例#2
0
        /// <summary>
        /// Constructor for the main class.
        /// </summary>
        public FullScreenDialog()
        {
            //
            // Required for Windows Form Designer support.
            //
            InitializeComponent();

            // Create a new DrawDevice.
            InitDirectDraw();

            dialogSample = new DialogSampleForm(); // Create a new dialog box to display.
            this.AddOwnedForm(dialogSample);       // Add the dialog as a child to this form.
            dialogSample.TopMost = true;           // Makes the window stay on top of everything else.
            dialogSample.Show();                   // Display the dialog.

            // Keep looping until told to quit.
            while (Created)
            {
                ProcessNextFrame();     // Process and draw the next frame.
                Application.DoEvents(); // Make sure the app has time to process messages.
            }
        }