本文整理汇总了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();
}
}
示例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();
}
示例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;
}
示例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");
}
}
示例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");
}
}
}
示例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;
}
示例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");//转到错误页面
}
}
示例8: MainMenu_Click
private void MainMenu_Click(object sender, EventArgs e)
{
Menu menu1 = new Menu();
menu1.Show();
this.Hide();
DeafeatSound.Stop();
}
示例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.";
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例14: Stack
public void Stack(Menu nextMenu)
{
if(nextMenu == null)
return;
currentMenu = nextMenu;
Hide();
nextMenu.previousMenu = this;
nextMenu.Show();
nextMenu.OnStack();
}
示例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();
}