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


C# MainMenu.Show方法代码示例

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


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

示例1: Open

        public static void Open(Pinball Pinball, Form Owner=null)
        {


            foreach (Form F in Application.OpenForms)
            {
                if (F.GetType() == typeof(MainMenu))
                {
                    F.BringToFront();
                    F.Focus();
                    return;
                }
            }

            MainMenu M = new MainMenu(Pinball);

            if (Owner == null)
            {
                M.Show();
            }
            else
            {
                M.StartPosition = FormStartPosition.CenterParent;
                M.Show(Owner);
            }
        }
开发者ID:ewingnnut,项目名称:DirectOutput,代码行数:26,代码来源:MainMenu.cs

示例2: debugLogin_Click

 private void debugLogin_Click(object sender, EventArgs e)
 {
     MainMenu mainPage = new MainMenu();
     mainPage.loginPage = this;
     mainPage.Show();
     Hide();
 }
开发者ID:CBusMB,项目名称:CrestAccountingSystem---v2.0,代码行数:7,代码来源:LogIn.cs

示例3: RulesBackButton_Click

 private void RulesBackButton_Click(object sender, EventArgs e)
 {
     this.Hide();
     var myForm = new MainMenu();
     myForm.Closed += (send, args) => this.Close();
     myForm.Show();
 }
开发者ID:heibelcj,项目名称:SettlersOfCatanProject,代码行数:7,代码来源:RulesForm.cs

示例4: loginBT_Click

        private void loginBT_Click(object sender, EventArgs e)
        {
            if (usernameTB.Text.Length > 0 && passwordTB.Text.Length > 0) // Έλεγχος
            {

                var userid = DB.DbQueries.AuthenticateAuthor(usernameTB.Text, passwordTB.Text);

                if (userid > 0)
                {
                    ActiveAuthor.SetCurrentAuthor(userid); // Θέτουμε τον ActiveAuthor
                    var mm = new MainMenu { Tag = this }; // Ανοίγουμε το Main Menu
                    mm.Show(this);
                    Hide();
                }
                else if (userid == 0)
                {
                    MessageBox.Show("Invalid Username/Password!",
                       "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

            }
            else
            {
                MessageBox.Show("You need to enter Username and Password!",
                    "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
开发者ID:cs1msa,项目名称:multiplechoiceadopse,代码行数:27,代码来源:LoginForm.cs

示例5: AmericanFlag_Click

        private void AmericanFlag_Click(object sender, EventArgs e)
        {
            // default language is English so no need to set language

            this.Hide();
            var myForm = new MainMenu();
            myForm.Closed += (send, args) => this.Close();
            myForm.Show();
        }
开发者ID:heibelcj,项目名称:SettlersOfCatanProject,代码行数:9,代码来源:ChooseLanguageForm.cs

示例6: SpanishFlag_Click

        private void SpanishFlag_Click(object sender, EventArgs e)
        {
            // set language
            Global_Variables.language = "Spanish";

            this.Hide();
            var myForm = new MainMenu();
            myForm.Closed += (send, args) => this.Close();
            myForm.Show();
        }
开发者ID:heibelcj,项目名称:SettlersOfCatanProject,代码行数:10,代码来源:ChooseLanguageForm.cs

示例7: MainWindow

 public MainWindow()
 {
     InitializeComponent();
     this.ClientSize = new Size(1280, 720);
     menu = new MainMenu();
     menu.Parent = this;
     menu.Dock = DockStyle.Fill;
     menu.selectItem += Menu_selectedItem;
     menu.Show();
 }
开发者ID:HitCZ,项目名称:SpaceShooter,代码行数:10,代码来源:MainWindow.cs

示例8: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 )
            {
                MessageBox.Show("isi semua field ");
            }
            else
            {
                try
                {

                    ds = new DataSet();
                    Da = new SqlDataAdapter("Select * from MsUser where Username='" + textBox1.Text + "' and Password='"+textBox2.Text+"' ", con.conn);
                    Da.Fill(ds, "Administrator");

                    if (ds.Tables["Administrator"].Rows.Count == 0)
                    {
                        MessageBox.Show("Username dan Password Salah!!");
                    }
                    else
                    {
                        Username = ds.Tables["Administrator"].Rows[0][0].ToString();
                        Password = ds.Tables["Administrator"].Rows[0][1].ToString();
                        Admin = ds.Tables["Administrator"].Rows[0][4].ToString();

                        if (Admin.Equals("1"))
                        {
                            MessageBox.Show("Selamat Datang Administrator");
                        }
                        else
                        {
                            MessageBox.Show("Selamat Datang User");
                        }

                        MainMenu mm = new MainMenu();

                        mm.login(Admin);
                        mm.Show();
                        this.Hide();
                    }
                }

                catch (Exception)
                {

                    MessageBox.Show("Username dan Password tidak ditemukan");
                    clear();
                }
            }
        }
开发者ID:sinakal,项目名称:ARCMSDesktop,代码行数:50,代码来源:Login.cs

示例9: LoginPacketResponse

        private void LoginPacketResponse(Packet p)
        {
            var resp = p as LoginResponsePacket;

            if (resp == null)
                return;

            if (this.InvokeRequired)
            {
                this.Invoke((new Action(() => LoginPacketResponse(p))));
                return;
            }


            if (resp.Status == "200")
            {

                RH_APP.Classes.Settings.GetInstance().authToken = resp.AuthToken;
                RH_APP.Classes.Settings.GetInstance().CurrentUser = resp.User;
                if (resp.User.IsSpecialist || resp.User.IsAdministrator)
                {
                    //var mainScreen = new MainScreen(true);
                    TCPController.OnPacketReceived -= LoginPacketResponse;
                    //mainScreen.ShowDialog();

                    this.Hide();
                    MainMenu m = new MainMenu();
                    m.Show();
                }
                else if (resp.User.IsClient)
                {
                        this.Hide();
                        //var mainScreen = new MainScreen(false);
                        var mainScreen = new TrainingScreen(false);
                        TCPController.OnPacketReceived -= LoginPacketResponse;
                        mainScreen.Text = " Remote Healthcare - Client Edition";
                        mainScreen.ShowDialog();

                }
            }
            else
            {
                MessageBox.Show(resp.Description, "Your application has been reviewed");
            }

            

        }
开发者ID:JordySipkema,项目名称:LD326_RH_A5,代码行数:48,代码来源:LoginScreen.cs

示例10: loginButton_Click

        private void loginButton_Click(object sender, EventArgs e)
        {

            employeeTableAdapter.Fill(crestAccountingDatabaseDataSet.Employee);
            var employees = from c in crestAccountingDatabaseDataSet.Employee 
                            where UserNametextBox.Text == c.UserName &&
                            passwordtextbox.Text == c.Password
                            select c;

            if (employees.Count() == 1)
            {
                MainMenu mainPage = new MainMenu();
                mainPage.loginPage = this;
                mainPage.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("User name or password is incorrect.");
            }
        }
开发者ID:CBusMB,项目名称:CrestAccountingSystem---v2.0,代码行数:21,代码来源:LogIn.cs

示例11: btnLogin_Click

 private void btnLogin_Click(object sender, EventArgs e)
 {
     validateAll();
     if(isValid == 0)
     {
         SQLStatement con = new SQLStatement(SLS.Static.Server, SLS.Static.Database);
         String sql = "SELECT UserID, [password]  FROM [USER] where username COLLATE Latin1_General_CS_AS = @username";
         Dictionary<String, Object> parameters = new Dictionary<string, object>();
         parameters.Add("@username", txtUser.Text);
         SqlDataReader reader = con.executeReader(sql, parameters);
         if (reader.HasRows)
         {
             reader.Read();
             if(txtPass.Text == Convert.ToString(reader.GetString(1)))
             {
                 MessageBox.Show("Login success.", "Logged In", MessageBoxButtons.OK);
                 this.Hide();
                 SLS.Static.UserID = Convert.ToInt32(reader.GetInt32(0));
                 var Menu = new MainMenu();
                 Menu.Closed += (s, args) => this.Close();
                 Menu.Show();
             }
             else
             {
                 e2.Visible = true;
                 MessageBox.Show("The password you entered is incorrect.", "Not Logged In", MessageBoxButtons.OK);
             }
         }
         else
         {
             e1.Visible = true;
             e2.Visible = true;
             MessageBox.Show("The username you entered does not belong to any account.", "Not Logged In", MessageBoxButtons.OK);
         }
     }
     else
     {
         MessageBox.Show("The username or password is incorrect.", "Not Logged In", MessageBoxButtons.OK);
     }
 }
开发者ID:mrtotz1129,项目名称:capstoneproj,代码行数:40,代码来源:Login.cs

示例12: YouLose

 private void YouLose()
 {
     Sounds.Death.Play();
     MessageBox.Show("You have lost!\n\r\n\rGAME OVER");
     MainMenu mainMenuMenu = new MainMenu();
     this.Hide();
     mainMenuMenu.Show();
 }
开发者ID:Team-Camaron,项目名称:SeaAdventures,代码行数:8,代码来源:BattleScreen.xaml.cs

示例13: GameBoard_OnKeyDown

        private void GameBoard_OnKeyDown(object sender, KeyEventArgs e)
        {
            var pressedKey = e.Key;

            if (this._gameOver == false)
            {
                if (pressedKey == Key.Up && this._player.Coordinates.X - 1 != -1
                    || pressedKey == Key.Down && this._player.Coordinates.X + 1 != 20
                    || pressedKey == Key.Left && this._player.Coordinates.Y - 1 != -1
                    || pressedKey == Key.Right && this._player.Coordinates.Y + 1 != 30)
                {
                    int newXCoordinate = -1;
                    int newYCoordinate = -1;

                    switch (pressedKey)
                    {
                        case Key.Up:
                            newXCoordinate = this._player.Coordinates.X - 1;
                            newYCoordinate = this._player.Coordinates.Y;
                            break;
                        case Key.Down:
                            newXCoordinate = this._player.Coordinates.X + 1;
                            newYCoordinate = this._player.Coordinates.Y;
                            break;
                        case Key.Left:
                            newXCoordinate = this._player.Coordinates.X;
                            newYCoordinate = this._player.Coordinates.Y - 1;
                            break;
                        case Key.Right:
                            newXCoordinate = this._player.Coordinates.X;
                            newYCoordinate = this._player.Coordinates.Y + 1;
                            break;
                    }

                    if (this._sea.Map[newXCoordinate, newYCoordinate] != 1)
                    {
                        this._player.Coordinates = new Point(newXCoordinate, newYCoordinate);

                        foreach (Enemy enemy in this._sea.GameObjectsContainer.OfType<Enemy>())
                        {
                            if (enemy.IsAlive)
                            {
                                enemy.UpdateRoutePosition();

                                bool isPlayerInRange = this.CheckIsPlayerInRange(enemy);

                                if (isPlayerInRange)
                                {
                                    BattleScreen bs = new BattleScreen(this._player, enemy, this);
                                    this.Hide();
                                    bs.Show();
                                }
                            }
                        }

                        this.Redraw();

                        // if the player has taken item
                        foreach (Item item in this._sea.GameObjectsContainer.OfType<Item>().Where(x => !x.IsTaken))
                        {
                            if (item.Coordinates.X == this._player.Coordinates.X
                                && item.Coordinates.Y == this._player.Coordinates.Y)
                            {
                                item.IsTaken = true;
                                this.Redraw();
                                var player = this._player;
                                if (player != null)
                                {
                                    player.AddToInventory(item);
                                }

                                string itemStats = this.GetItemCharacteristic(item);
                                MessageBox.Show(
                                    string.Format("You have found\n{0}!\n{1}", item.GetType().Name, itemStats));

                                // #WIN CONDITION if item is pearl
                                if (item is Pearl)
                                {
                                    var image = new BitmapImage();
                                    image.BeginInit();
                                    image.UriSource = new Uri(
                                        "/SeaAdventure;component/Resources/Screen_YouWin.png",
                                        UriKind.Relative);
                                    image.EndInit();
                                    this.YouWinControl.Source = image;
                                    this._gameOver = true;
                                    this.SaveScore();
                                    MessageBox.Show("Start a new game?");
                                    MainMenu mainMenuMenu = new MainMenu();
                                    this.Hide();
                                    mainMenuMenu.Show();
                                }
                            }
                        }

                        UIElement instructionWindow = this.GameCanvas.FindName("InstructionsWindow") as UIElement;
                        if (this.GameCanvas.Children.Contains(instructionWindow))
                        {
                            this.GameCanvas.Children.Remove(instructionWindow);
                        }
//.........这里部分代码省略.........
开发者ID:Team-Camaron,项目名称:SeaAdventures,代码行数:101,代码来源:GameBoard.xaml.cs

示例14: btnCBack_Click

 private void btnCBack_Click(object sender, RoutedEventArgs e)
 {
     MainMenu menu = new MainMenu();
     menu.Activate();
     this.Close();
     menu.Show();
 }
开发者ID:KarateGeekTeamCY,项目名称:KarateGeekCsharpEdition,代码行数:7,代码来源:ClubManagement.xaml.cs

示例15: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     Form MainMenu = new MainMenu();
     MainMenu.Show();
     this.Close();
 }
开发者ID:roric32,项目名称:inferno,代码行数:6,代码来源:GameForm.cs


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