Пример #1
0
        private void cboWindowMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Settings.Default.windowModeIndex != cboWindowMode.SelectedIndex)
            {
                Settings.Default.windowModeIndex = cboWindowMode.SelectedIndex;
                Settings.Default.Save();

                var f = new TestForm();
                f.Location = this.Location;
                f.Size     = this.Size;

                switch (cboWindowMode.SelectedIndex)
                {
                case 0:     // Standalone
                    f.ShowInTaskbar = true;
                    f.Show();
                    break;

                case 1:     // Modeless
                    f.ShowInTaskbar = false;
                    f.Show(VissimHandle);
                    break;

                case 2:     // Modal
                    f.ShowInTaskbar = false;
                    this.Hide();
                    f.ShowDialog(VissimHandle);
                    break;

                case 3:     // Topmost
                    f.ShowInTaskbar = true;
                    f.TopMost       = true;
                    f.Show();
                    break;
                }

                this.Close();
            }
        }
Пример #2
0
        private void cboWindowMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Settings.Default.windowModeIndex != cboWindowMode.SelectedIndex)
            {
                Settings.Default.windowModeIndex = cboWindowMode.SelectedIndex;
                Settings.Default.Save();

                var f = new TestForm();
                f.Location = this.Location;
                f.Size = this.Size;

                switch (cboWindowMode.SelectedIndex)
                {
                    case 0: // Standalone
                        f.ShowInTaskbar = true;
                        f.Show();
                        break;
                    case 1: // Modeless
                        f.ShowInTaskbar = false;
                        f.Show(VissimHandle);
                        break;
                    case 2: // Modal
                        f.ShowInTaskbar = false;
                        this.Hide();
                        f.ShowDialog(VissimHandle);
                        break;
                    case 3: // Topmost
                        f.ShowInTaskbar = true;
                        f.TopMost = true;
                        f.Show();
                        break;
                }

                this.Close();
            }
        }