当前位置: 首页>>代码示例>>C#>>正文


C# Menu.ShowDialog方法代码示例

本文整理汇总了C#中Menu.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.ShowDialog方法的具体用法?C# Menu.ShowDialog怎么用?C# Menu.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Menu的用法示例。


在下文中一共展示了Menu.ShowDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: link_Back_LinkClicked

 private void link_Back_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Menu menu = new Menu();
     this.Hide();
     menu.ShowDialog();
      this.Close();
 }
开发者ID:engineeringjoey,项目名称:EquipmentRentApp3,代码行数:7,代码来源:Add_NewItem.cs

示例2: linkLabel1_LinkClicked

 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     videoSourcePlayer1.SignalToStop();
     Menu menu = new Menu();
     this.Hide();
     menu.ShowDialog();
     this.Close();
 }
开发者ID:engineeringjoey,项目名称:EquipmentRentApp3,代码行数:8,代码来源:ReceiveOrder.cs

示例3: btnCalc_Click

 private void btnCalc_Click(object sender, EventArgs e)
 {
     double R;
     double.TryParse(txtR.Text, out R);
     txtResult.Text = calculator.task1(R).ToString();
     Menu frm = new Menu();
     frm.ShowDialog();            
 }
开发者ID:kapranowroman,项目名称:Tasks,代码行数:8,代码来源:Form1.cs

示例4: Entrar_Click

        private void Entrar_Click(object sender, EventArgs e)
        {
            /* setKey(usuario.Text, contrasena.Text);
            try
            {
                con.Open();*/
                Menu menu = new Menu();
            this.Hide();
            menu.ShowDialog();

               /* }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }*/
        }
开发者ID:josselynmedina,项目名称:Sistema-Evaluador,代码行数:16,代码来源:Form1.cs

示例5: Entrar_Click

        private void Entrar_Click(object sender, EventArgs e)
        {
            setKey(usuario.Text, contrasena.Text);

            try
            {
                con.Open();
                con.Close();
                Menu menu = new Menu(con, this);
                this.Hide();
                menu.ShowDialog();
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            /**catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }**/
        }
开发者ID:josselynmedina,项目名称:SED,代码行数:21,代码来源:Login.cs

示例6: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            /*

            this.usuario = this.txtUsuario.Text;
            string contrasena = this.txtContraseña.Text;
            Sesion sesion = new Sesion(conexion);//instancia la clase de las conculsta

            string resultado = sesion.verificaUsuario(this.usuario, contrasena);// se iguala el return del metodo

            if (resultado.Equals("Ingreso"))//si viene vacio no retorno error en contraseña o id
            {*/

                this.Visible = false;
                Menu menu = new Menu(this.conexion);
                menu.ShowDialog();
            /*}
            else// si viene diferente a vacio se concatena el error
            {
                MessageBox.Show("Ha ocurrido el siguiente error: " + resultado);
            }*/
        }
开发者ID:NeTa05,项目名称:CliniSalud,代码行数:22,代码来源:SesionVista.cs

示例7: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     Menu frm = new Menu();
     frm.ShowDialog();
 }
开发者ID:epcjc,项目名称:LP1213_M17_07,代码行数:5,代码来源:Iniciar.cs

示例8: Button_Click_1

 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     Menu Menu = new Menu();
     Menu.ShowDialog();
 }
开发者ID:qwartet,项目名称:My-project,代码行数:5,代码来源:Registration.xaml.cs

示例9: Form1_Shown

 private void Form1_Shown(object sender, EventArgs e)
 {
     Menu menu = new Menu(ref game);
     menu.StartPosition = FormStartPosition.CenterParent;
     var result = menu.ShowDialog(this);
     if (result == DialogResult.Yes)
     {
         game.LoadInitData();
         updateStats();
         UpdateGraphics();
     }
     else if (result == DialogResult.OK)
     {
         game.LoadInitData();
         game.LoadState(watcher);
         updateStats();
         UpdateGraphics();
     }
     else
         Application.Exit();
 }
开发者ID:AlfaBlommaN,项目名称:Monopol,代码行数:21,代码来源:Form1.cs

示例10: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "ALVES DIAS")
            {
                Menu mn = new Menu("ALVES DIAS");
                mn.ShowDialog();

            }
            else if(comboBox1.Text == "BAETA NEVES")
            {
                Menu mn = new Menu("BAETA NEVES");
                mn.ShowDialog();

            }
            else if(comboBox1.Text == "DEMARCHI")
            {
                Menu mn = new Menu("DEMARCHI");
                mn.ShowDialog();

            }
            else if(comboBox1.Text == "PAULICÉIA")
            {
                Menu mn = new Menu("PAULICÉIA");
                mn.ShowDialog();

            }
            else if (comboBox1.Text == "RIACHO GRANDE")
            {
                Menu mn = new Menu("RIACHO GRANDE");
                mn.ShowDialog();

            }
            else if (comboBox1.Text == "RUDGE RAMOS")
            {
                Menu mn = new Menu("RUDGE RAMOS");
                mn.ShowDialog();

            }
            else if (comboBox1.Text == "SÃO PEDRO")
            {
                Menu mn = new Menu("SÃO PEDRO");
                mn.ShowDialog();

            }
            else if (comboBox1.Text == "SILVINA")
            {
                Menu mn = new Menu("SILVINA");
                mn.ShowDialog();

            }
            else if (comboBox1.Text == "UNIÃO")
            {
                Menu mn = new Menu("UNIÃO");
                mn.ShowDialog();

            }
            else if (comboBox1.Text == "SAMU")
            {
                Menu mn = new Menu("SAMU");
                mn.ShowDialog();

            }
            else if (comboBox1.Text == "DAHUE")
            {
                Menu mn = new Menu("DAHUE");
                mn.ShowDialog();

            }
            else
            {
                MessageBox.Show("Não foi reconhecida a unidade", "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:vinidg,项目名称:sistema-solicitacao-prontuarios,代码行数:73,代码来源:MenuUpa.cs

示例11: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     Menu m = new Menu();
     this.Hide();
     m.ShowDialog();
 }
开发者ID:josselynmedina,项目名称:SED,代码行数:6,代码来源:Login.cs

示例12: Window_KeyDown

        public void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            switch (e.Key)
            {
                case Key.C:
                    {
                        CoinIn();
                        break;
                    }
                case Key.Escape:
                    {
                        Close();

                        break;
                    }
                case Key.M:
                    {
                        var menu = new Menu(_vitrola);
                        menu.ShowDialog();
                        if (menu.CloseWindows)
                        {
                            var p = new ProcessStartInfo("cmd", "/c " + "shutdown -p") { CreateNoWindow = true };
                            var a = new Process { StartInfo = p };
                            a.Start();
                            Close();
                        }
                        if (menu.CloseProgram)
                        {
                            Close();
                        } 
                        _vitrola.UpdateCollectionMiddle(Vitrola.TypesList.Genre);
                        _vitrola.UpdateCollectionMiddle(Vitrola.TypesList.Artist);
                        _vitrola.UpdateCollectionMiddle(Vitrola.TypesList.Track);
                        _vitrola.NotifyChanged("SelectedGenre");//actualiza las dependencias de seleccion
                        _vitrola.NotifyChanged("SelectedArtist");

                        bigScreen.SetVolume(_vitrola.Volumen);
                        PublicityMove();

                        if (!_vitrola.ViewMiniature)
                            mediaElement.Stop();
                        else if (listBoxTrack.SelectedIndex != -1)
                        {
                            PlayMiniature();
                        }
                        //listBoxArtist.ApplyTemplate();
                        //listBoxArtist.InvalidateArrange();
                        //listBoxArtist.InvalidateVisual();
                        //InitializeComponent();
                        break;
                    }
                case Key.Enter:
                    {
                        if (listBoxTrack.SelectedIndex == -1)
                            break;
                        if (_vitrola.Money < _vitrola.ValueTrack)
                        {
                            textBlockMoney.Background = Brushes.Red;
                            labelMoney.Background = Brushes.Red;
                            break;
                        }

                        listBoxTrack.BorderBrush = ColorBrush;
                        //var lbi = (ListBoxItem)listBoxTrack.ItemContainerGenerator.ContainerFromItem(
                        //     listBoxTrack.SelectedValue);
                        var lbi = (ListBoxItem)listBoxTrack.ItemContainerGenerator.ContainerFromIndex(
                             listBoxTrack.SelectedIndex);
                        
                        lbi.BorderThickness = new Thickness(10, 1, 1, 1);
                        lbi.Opacity = 0.5;
                        int c = listBoxTrack.Items.Count < 10 ? listBoxTrack.Items.Count : 10;
                        for (int i = 0; i < c; i++)
                        {
                            var lb = (ListBoxItem)listBoxTrack.ItemContainerGenerator.ContainerFromIndex(i);
                            lb.IsEnabled = false;
                        }
                        lbi.IsEnabled = true;
                        if (bigScreen != null && listBoxTrack.SelectedValue != null)
                        {
                            if (listBoxReproduction.Items.Count > 0 &&
                                listBoxTrack.SelectedValue == listBoxReproduction.Items[listBoxReproduction.Items.Count - 1])
                                break;
                            var dir = _vitrola.DirTracks[listBoxTrack.SelectedIndex];
                            var name = _vitrola.Tracks[listBoxTrack.SelectedIndex];
                            bigScreen.AddTrack(dir, name);
                            
                            SelectTrack();
                        }
                    }
                    break;
                case Key.Z:
                    {
                        bigScreen.NextTrack();
                    }
                    break;
                case Key.E: //arriba de Género
                    {
                        if (listBoxGenre.SelectedIndex == -1)
                            break;
                        UpGenreDown();
//.........这里部分代码省略.........
开发者ID:oisbel,项目名称:Vitrola,代码行数:101,代码来源:MainWindow.xaml.cs

示例13: loginButton_Click

        /// <summary>
        /// Grabs the entered username and password and validates them against the credentials stored in the database.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void loginButton_Click(object sender, EventArgs e)
        {
            bool validLogin = false;
                //Get the username
                string username = usernameTB.Text;

                //get the password
                string password = Account.ProtectPassword(passwordTB.Text);
                //string password = passwordTB.Text;

                //Now check to see if they are valid
                DataSet ds = Account.getUserAccountRecord(username);

                if (ds.Tables["tableName"].Rows.Count == 0)
                {//Invalid Username
                    //Could this be a sever login??
                    if (username == sqlQuery.getGlobalizedSettings("serverUsername") && passwordTB.Text == sqlQuery.getGlobalizedSettings("serverPassword"))
                    {
                        ServerForm myForm = new ServerForm();
                        this.Hide();

                        //Update the timestamp
                        validLogin = false;
                        myForm.ShowDialog();
                        this.Show();
                        usernameTB.Clear();
                        passwordTB.Clear();
                        usernameTB.Focus();
                    }
                    else
                    {
                        MessageBox.Show("You have entered an invalid username.", "Invalid Username", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        usernameTB.Clear();
                        passwordTB.Clear();
                        usernameTB.Focus();
                    }
                }
                else
                {//Valid Username so check password
                    //usernameTB.Text = ds.Tables[0].Rows[0]["loginName"].ToString();
                    string passwordInDB = ds.Tables[0].Rows[0]["password"].ToString();
                    if (password == passwordInDB)
                    {
                        validLogin = true;
                    }
                    else
                    {
                        MessageBox.Show("You have entered an invalid password.", "Invalid username", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        usernameTB.Clear();
                        passwordTB.Clear();
                        usernameTB.Focus();
                    }
                }

                if (validLogin)
                {
                    Menu menuForm = new Menu(username);
                    this.Hide();

                    //Update the timestamp
                    Account.loginTimestamp(username);
                    validLogin = false;
                    menuForm.ShowDialog();
                    this.Show();
                    usernameTB.Clear();
                    passwordTB.Clear();
                    usernameTB.Focus();
                }
        }
开发者ID:ThomasMoreCollege,项目名称:CinderellaMGS,代码行数:74,代码来源:Login.cs

示例14: Main

        static void Main()
        {
            Storage xmlStorage = new Storage();

            Form splashScreen = new SplashScreen();
            splashScreen.Show();
            Thread.Sleep(1000);
            splashScreen.Close();

            Menu menu = new Menu(xmlStorage.previousGame());
            menu.ShowDialog();
            string menuChoice = menu.buttonEvent;

            if (menuChoice != "EXIT")
            {
                GameEngine GE;
                if (menuChoice == "PLAYER_VS_PLAYER")
                {
                    xmlStorage.clearData();
                    xmlStorage.setPvP("Yes");
                    Board p1 = new Board(true, "Player1", xmlStorage); //Player 1 is human
                    Board p2 = new Board(true, "Player2", xmlStorage); //PLayer 2 is human
                    GE = new GameEngine(p1, p2, xmlStorage);
                    GameScreen gameScreen = new GameScreen(GE, p1, p2);
                    gameScreen.ShowDialog();
                }
                else if (menuChoice == "PLAYER_VS_PC")
                {
                    xmlStorage.clearData();
                    xmlStorage.setPvP("No");
                    Board p1 = new Board(true, "Player1", xmlStorage); //Player 1 is human
                    Board p2 = new Board(false, "Player2", xmlStorage); //PLayer 2 is PC
                    GE = new GameEngine(p1, p2, xmlStorage);
                    GameScreen gameScreen = new GameScreen(GE, p1, p2);
                    gameScreen.ShowDialog();
                }
                else if (menuChoice == "LOAD_SAVED_GAME")
                {
                    //Load from xmlStorage
                    Board p1 = new Board("Player1", xmlStorage);
                    Board p2 = new Board("Player2", xmlStorage);
                    GE = new GameEngine(p1, p2, xmlStorage);
                    GE.setTurn(xmlStorage.getTurn());
                    GE.setPhase(xmlStorage.getPhase());
                    GameScreen gameScreen = new GameScreen(GE, p1, p2);
                    gameScreen.ShowDialog();

                }
            }
        }
开发者ID:iawls,项目名称:Battleships,代码行数:50,代码来源:GameEngine.cs

示例15: btnAtras_Click

 private void btnAtras_Click(object sender, EventArgs e)
 {
     this.Visible = false;
     Menu menu = new Menu(this.conexion);
     menu.ShowDialog();
 }
开发者ID:NeTa05,项目名称:CliniSalud,代码行数:6,代码来源:Cliente.cs


注:本文中的Menu.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。