本文整理汇总了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();
}
示例2: linkLabel1_LinkClicked
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
videoSourcePlayer1.SignalToStop();
Menu menu = new Menu();
this.Hide();
menu.ShowDialog();
this.Close();
}
示例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();
}
示例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);
}*/
}
示例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);
}**/
}
示例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);
}*/
}
示例7: button1_Click
private void button1_Click(object sender, EventArgs e)
{
Menu frm = new Menu();
frm.ShowDialog();
}
示例8: Button_Click_1
private void Button_Click_1(object sender, RoutedEventArgs e)
{
Menu Menu = new Menu();
Menu.ShowDialog();
}
示例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();
}
示例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);
}
}
示例11: button1_Click
private void button1_Click(object sender, EventArgs e)
{
Menu m = new Menu();
this.Hide();
m.ShowDialog();
}
示例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();
//.........这里部分代码省略.........
示例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();
}
}
示例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();
}
}
}
示例15: btnAtras_Click
private void btnAtras_Click(object sender, EventArgs e)
{
this.Visible = false;
Menu menu = new Menu(this.conexion);
menu.ShowDialog();
}