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


C# Menu.Show方法代码示例

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


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

示例1: buttonEnter_Click

        private void buttonEnter_Click(object sender, EventArgs e)
        {
            LibraryEntities context = new LibraryEntities();
            var clients = context.Clients;

            bool flag = false;
            foreach (var item in clients)
            {
                if (int.Parse(textBoxID.Text) == item.ClientID && textBoxEGN.Text.Trim() == item.EGN.Trim())
                {
                    flag = true;
                }
            }
            if (flag == true)
            {
                Menu menu = new Menu(int.Parse(textBoxID.Text));
                menu.Show();
                InitializeMyControl();
                Clear();
            }
            else
            {
                MessageBox.Show("Грешка! Невалидна парола!");
                InitializeMyControl();
                Clear();
            }
        }
开发者ID:nikup,项目名称:Library-IT-Olympiad,代码行数:27,代码来源:Form1.cs

示例2: buttonLogin_Click

        private void buttonLogin_Click(object sender, EventArgs e)
        {
            LibraryEntities1 context = new LibraryEntities1();
            var accaunts = context.Accaunts;

            bool flag = false;
            foreach (var item in accaunts)
            {
                if (textBoxLogin.Text.Trim() == item.Login.Trim()  &&  CalculateSHA1(textBoxPassword.Text).Trim()== item.PasswordSHA1.Trim())
                {

                    flag = true;
                    Menu formMenu = new Menu(0);

                    formMenu.Show();

                }
                if (textBoxLogin.Text.Trim() == "administrator".Trim () && CalculateSHA1(textBoxPassword.Text).Trim() == item.PasswordSHA1.Trim())
                {
                    flag = true;
                    Menu formMenu = new Menu(1);
                    formMenu.Show();
                }
            }
            if (!flag)
            {
                MessageBox.Show("Грешка! Невалидна парола!");
                InitializeMyControl();
                Clear();
            }
            Clear();
        }
开发者ID:nikup,项目名称:Library-IT-Olympiad,代码行数:32,代码来源:FormLogin.cs

示例3: MenuCommand

        public static bool MenuCommand(GtaPlayer player)
        {
            var m = new Menu("Test menu", Vector2.Zero);

            m.Columns.Add(new MenuColumn(100));

            m.Rows.Add(new MenuRow("Active"));
            m.Rows.Add(new MenuRow("Disabled", true));
            m.Rows.Add(new MenuRow("Active2"));

            m.Show(player);

            m.Exit += (o, eventArgs) =>
            {
                player.SendClientMessage(Color.Red, "MENU CLOSED");
                m.Dispose();
            };

            m.Response += (o, eventArgs) =>
            {
                player.SendClientMessage(Color.Green, "SELECTED ROW " + eventArgs.Row);
                m.Dispose();
            };

            return true;
        }
开发者ID:WLSF,项目名称:SampSharp,代码行数:26,代码来源:MenuTest.cs

示例4: btnAdd_Click

 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     if (isFormValid())
     {
         if (addUser() == "1")
         {
             Menu win = new Menu();
             win.Left = this.Left;
             win.Top = this.Top;
             win.Show();
             this.Close();
         }
         else
         {
             //not successful
             var dialogBox = MessageBox.Show("A user with the given Healthcare Id already exists. " +
                 "Create a different user or contact a programmer for more assistance.",
                 "Unsuccessful Database Insertion");
         }
     }
     else
     {
         var dialogBox = MessageBox.Show("The given information is not valid to insert into the database. " +
                 "Check that the name and Healthcare Id fields are filled properly. " + 
                 "If this problem persists, contact a programmer for further assistance.",
                 "Invalid Entry");
     }
 }
开发者ID:ep2012,项目名称:OCP-2.0,代码行数:28,代码来源:AddUser.xaml.cs

示例5: btLogin_Click

        private void btLogin_Click(object sender, EventArgs e)
        {
            if (validateCredentials())
            {
                try
                {
                    if(DBLogic.con.State == ConnectionState.Closed)
                        DBLogic.con.Open();

                    string city = "";
                    int index = cmbCampus.SelectedIndex;

                    if (index == 0)
                        city = "San Pedro Sula";
                    else if (index == 1)
                        city = "Ceiba";
                    else if (index == 2)
                        city = "Tegucigalpa";

                    Menu st = new Menu(city);
                    st.Show();
                    //DBLogic.con.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "ERROR");
                }
            }
        }
开发者ID:ErickHernandez,项目名称:Proyecto_1_BD2,代码行数:29,代码来源:Login.cs

示例6: ShowSubMenu

		public static bool ShowSubMenu ()
		{
			List<IMenuItem> items = new List<IMenuItem> ();
			var nameItem = new MenuItemWithCharacterInput("Name", "Enter Name", "Anders");
			var ageItem = new MenuItemWithNumericInput("Age", 29, 0, 100);
			var genderItem = new MenuItemWithOptions<string>("Option", new string[]{"Male","Female"});
			var programItem = new MenuItemWithCheckBox("Loves C#", true);
			var checkBoxWithActionItem = new MenuItemWithCheckBox("Execute", true, TurnCheckBoxOnOff);
			
			items.Add(nameItem);
			items.Add(ageItem);
			items.Add(genderItem);
			items.Add(programItem);
			items.Add(checkBoxWithActionItem);
			
			//Show the menu
			Menu m = new Menu ("Sub Menu", items);
			m.Show ();
			Console.WriteLine("Your name is " + nameItem.Text);
			Console.WriteLine("Your genger is " + genderItem.GetSelection().ToString());
			Console.WriteLine("Your age is " + ageItem.Value);
			if(programItem.Checked)
				Console.WriteLine(nameItem.Text + " loves C#");
			Console.WriteLine("Is checked: " + checkBoxWithActionItem.Checked);			
			return false;
		}
开发者ID:RoninWest,项目名称:monoev3,代码行数:26,代码来源:Program.cs

示例7: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            string str = "";
            int a=0;
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load("ATM.xml");
            XmlNodeList usersList = xmlDoc.SelectNodes("/Table/User");
            bool NoofYes = false;
            for (int i = 0; i < usersList.Count; i++)
            {
                if (textBox1.Text.Equals(usersList[i].SelectSingleNode("ID").InnerText) && textBox2.Text.Equals(usersList[i].SelectSingleNode("Password").InnerText))
                {
                    NoofYes = true;
                    str = usersList[i].SelectSingleNode("ID").InnerText;
                    a = i;
                    break;
                }
            }

            if (NoofYes == true)
            {
                Form frm2 = new Menu(str,a);
                this.Visible = false;
                //this.Hide();
                frm2.Show(this);
            }
            else
            {
                MessageBox.Show("ID or Password is worng");//转到错误页面
            }
        }
开发者ID:youmufreedom,项目名称:Test,代码行数:31,代码来源:Login+Interface.cs

示例8: MainMenu_Click

 private void MainMenu_Click(object sender, EventArgs e)
 {
     Menu menu1 = new Menu();
     menu1.Show();
     this.Hide();
     DeafeatSound.Stop();
 }
开发者ID:kevinassen1992,项目名称:ICT1SE1A-groep2,代码行数:7,代码来源:DefeatScreen.cs

示例9: uredu_Click

        private void uredu_Click(object sender, EventArgs e)
        {
            string korisnik = korisnickoIme.Text;
            string sifra = lozinka.Text;
            try
            {
                DAO dao = new DAO("etf.ba", "ooadtim6", "ooadtim6", "ooadtim6");
                int id = dao.VratiUserID(korisnik, sifra);
                string uloga = dao.ProvjeriPristup(id);

                if (uloga == "Bibliotekar")
                {
                    Menu m = new Menu();
                    m.Show();
                    this.Hide();
                }
                else if (uloga == "Garderobijer")
                {
                    PronalazenjeMjesta pm = new PronalazenjeMjesta();
                    pm.Show();
                    this.Hide();
                }

            }
            catch (Exception)
            {
                statusStrip1.BackColor = Color.White;
                toolStripStatusLabel1.Text = "Neovlašten pristup.";
            }
        }
开发者ID:ik15151,项目名称:etf-2011-ooad-biblioteka,代码行数:30,代码来源:Login.cs

示例10: Exit_Click

 /*******************************************************************************************
  * Exit_Click
  * ****************************************************************************************/
 private void Exit_Click(object sender, RoutedEventArgs e)
 {
     Application.Current.Shutdown();
     Menu menu = new Menu();
     App.Current.MainWindow = menu;
     this.Close();
     menu.Show();
 }
开发者ID:nrage86,项目名称:Roleta,代码行数:11,代码来源:Menu.xaml.cs

示例11: Main

		public static void Main (string[] args)
		{
			List<IMenuItem> items = new List<IMenuItem>();
			items.Add (new MenuItemWithAction("Personal details", () => ShowSubMenu(),MenuItemSymbole.RightArrow));
			items.Add (new MenuItemWithAction("Execute steps", () => ExecuteSteps()));
			Menu m = new Menu("Main menu", items);
			m.Show();	
		}
开发者ID:RoninWest,项目名称:monoev3,代码行数:8,代码来源:Program.cs

示例12: btnCancel_Click

 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     Menu win = new Menu();
     win.Left = this.Left;
     win.Top = this.Top;
     win.Show();
     this.Close();
 }
开发者ID:ep2012,项目名称:OCP-2.0,代码行数:8,代码来源:AddUser.xaml.cs

示例13: dispatcherTimer_Tick

 private void dispatcherTimer_Tick(object sender, EventArgs e)
 {
     //Abre jogo (MainWindow)
     Menu menu = new Menu();
     App.Current.MainWindow = menu;
     this.Close();
     menu.Show();
     dispatcherTimer.Stop();
 }
开发者ID:nrage86,项目名称:Roleta,代码行数:9,代码来源:Menu.xaml.cs

示例14: Stack

 public void Stack(Menu nextMenu)
 {
     if(nextMenu == null)
         return;
     currentMenu = nextMenu;
     Hide();
     nextMenu.previousMenu = this;
     nextMenu.Show();
     nextMenu.OnStack();
 }
开发者ID:Orkad,项目名称:SpaceContest,代码行数:10,代码来源:Menu.cs

示例15: btn_finish_Click

 private void btn_finish_Click(object sender, System.EventArgs e)
 {
     Menu menu = Application.OpenForms.OfType<Menu>().FirstOrDefault();
     if (menu == null)
     {
         menu = new Menu();
         menu.Show();
     }
     this.Close();
 }
开发者ID:CindyEven,项目名称:MasterRecherche2015,代码行数:10,代码来源:Module1.cs


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