本文整理汇总了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);
}
}
示例2: debugLogin_Click
private void debugLogin_Click(object sender, EventArgs e)
{
MainMenu mainPage = new MainMenu();
mainPage.loginPage = this;
mainPage.Show();
Hide();
}
示例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();
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
}
示例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");
}
}
示例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.");
}
}
示例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);
}
}
示例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();
}
示例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);
}
//.........这里部分代码省略.........
示例14: btnCBack_Click
private void btnCBack_Click(object sender, RoutedEventArgs e)
{
MainMenu menu = new MainMenu();
menu.Activate();
this.Close();
menu.Show();
}
示例15: button1_Click
private void button1_Click(object sender, EventArgs e)
{
Form MainMenu = new MainMenu();
MainMenu.Show();
this.Close();
}