本文整理汇总了C#中System.Windows.Forms.Form.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# Form.Hide方法的具体用法?C# Form.Hide怎么用?C# Form.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Form
的用法示例。
在下文中一共展示了Form.Hide方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowForm
public static void ShowForm(Form form, bool show)
{
if (form.InvokeRequired)
{
form.BeginInvoke(new Action(() =>
{
if (show)
{
form.Show();
form.BringToFront();
form.WindowState = FormWindowState.Normal;
}
else
{
form.Hide();
form.WindowState = FormWindowState.Minimized;
}
}));
}
else
{
if (show)
{
form.Show();
form.BringToFront();
form.WindowState = FormWindowState.Normal;
}
else
{
form.Hide();
form.WindowState = FormWindowState.Minimized;
}
}
}
示例2: Activated
public void Activated ()
{
if (TestHelper.RunningOnUnix)
Assert.Ignore ("#3 fails");
_form = new Form ();
EventLogger logger = new EventLogger (_form);
_form.ShowInTaskbar = false;
Assert.AreEqual (0, logger.CountEvents ("Activated"), "#1");
_form.Activate ();
Application.DoEvents ();
Assert.AreEqual (0, logger.CountEvents ("Activated"), "#2");
_form.Show ();
Application.DoEvents ();
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#3");
_form.Show ();
Application.DoEvents ();
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#4");
_form.Activate ();
Application.DoEvents ();
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#5");
_form.Hide ();
Application.DoEvents ();
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#6");
_form.Show ();
Application.DoEvents ();
Assert.AreEqual (2, logger.CountEvents ("Activated"), "#7");
}
示例3: Game1
public Game1(IntPtr drawSurface)
{
Logger.Instance.log("Game1 creation started.");
Instance = this;
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = 800;
graphics.PreferredBackBufferHeight = 600;
Content.RootDirectory = "Content";
Logger.Instance.log("Creating Winform.");
this.drawSurface = drawSurface;
graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
winform = (Forms.Form)Forms.Form.FromHandle(Window.Handle);
winform.VisibleChanged += new EventHandler(Game1_VisibleChanged);
winform.Size = new System.Drawing.Size(10, 10);
Mouse.WindowHandle = drawSurface;
resizebackbuffer(MainForm.Instance.pictureBox1.Width, MainForm.Instance.pictureBox1.Height);
winform.Hide();
Logger.Instance.log("Winform created.");
Logger.Instance.log("Game1 creation ended.");
}
示例4: Reserva
public Reserva(Form parent, int opType)
{
this.parentForm = parent;
this.operationType = opType;
InitializeComponent();
parent.Hide();
}
示例5: EnterNewPuzzle
/// <summary>
/// Shows a blank game screen.
/// </summary>
/// <param name="form">This form will be hidden.</param>
public static void EnterNewPuzzle(Form form)
{
form.Hide();
GameForm gform = new GameForm(new Grid(), false);
gform.ShowDialog();
form.Close();
}
示例6: Entrar
public void Entrar(Form f, TextBox user, TextBox pass)
{
try{
sql = new SqlConnection(CadCon.Servidor());
sql.Open();
cmd = new SqlCommand("Entrar", sql);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@usuario", user.Text);
cmd.Parameters.AddWithValue("@pass", pass.Text);
int operacion = cmd.ExecuteNonQuery();
DataTable d = new DataTable();
SqlDataAdapter data = new SqlDataAdapter(cmd);
data.Fill(d);
if (d.Rows.Count >0)
{
LoadThread lt = new LoadThread();
lt.Show();
f.Hide();
}
else {
MessageBox.Show("Nombre de usuario o contraseña incorrectos\n", "",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
user.Focus();
pass.Clear();
}
cmd.Dispose();
sql.Close();
}
catch (SqlException s) { MessageBox.Show(s.Message); }
}
示例7: mostrarNuevaVentana
public static void mostrarNuevaVentana(Form ventanaNueva, Form ventanaPadre)
{
ventanaNueva.Visible = true;
ventanaNueva.Activate();
ventanaNueva.Select();
ventanaPadre.Hide();
}
示例8: Logout
public void Logout(Form currentForm)
{
currentForm.Hide();
_appGlobal.Logout();
Program.LoginForm.Show();
currentForm.Dispose();
}
示例9: SystemForm
public SystemForm(Form previous,StreamReader reader, StreamWriter writer)
{
InitializeComponent();
this.reader = reader;
this.writer = writer;
previous.Hide();
}
示例10: XnaGame
public XnaGame( IMainForm mainForm )
{
_mainForm = mainForm ;
_drawSurface = _mainForm.GetHandle( ) ;
Logger.Instance.log("Game1 creation started.");
_graphics = new GraphicsDeviceManager( this )
{
PreferredBackBufferWidth = 800,
PreferredBackBufferHeight = 600
} ;
Content.RootDirectory = "Content";
_graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
_winform = (Form)Form.FromHandle(Window.Handle);
_winform.VisibleChanged += game1VisibleChanged;
_winform.Size = new Size(10, 10);
Mouse.WindowHandle = _drawSurface;
Size pictureBoxSize = _mainForm.CanvasSize ;
ResizeBackBuffer( pictureBoxSize.Width, pictureBoxSize.Height ) ;
_winform.Hide();
}
示例11: openFile
public static void openFile( Form plcType,
Form main,
ComboBox height,
ToolStripProgressBar mLoad,
ToolStripStatusLabel mStatus )
{
bool noFile = true, cancel = false;
OpenFileDialog openDiag;
DialogResult res;
String filename;
mnuHeight = height;
mnuLoad = mLoad;
mnuStatus = mStatus;
init = true;
plcType.Hide();
while( noFile ^ cancel )
{
openDiag = new OpenFileDialog();
openDiag.Multiselect = false;
openDiag.AddExtension = true;
openDiag.DefaultExt = "dat";
openDiag.Filter = "Minecraft Levels (*.dat)|*.dat|" +
"All Files (*.*)|*.*";
res = openDiag.ShowDialog();
plcType.Show();
if( res == DialogResult.Cancel )
cancel = true;
else
{
filename = openDiag.FileName;
noFile = false;
openDiag.Dispose();
lvl = AnvilWorld.Open( filename );
if( lvl == null )
MessageBox.Show( "That file was not a compatible Minecraft level.",
"Open File Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error );
else
{
regDiag = new SelectRegion( lvl.GetRegionManager(), main );
loadLimits();
selectRegion( true );
}
}
}
}
示例12: Dialog_Form
public Dialog_Form(String Title, String Prompt, Form formPadre)
{
InitializeComponent();
this.label_Prompt.Text = Prompt;
this.Text = Title;
parent_Form = formPadre;
parent_Form.Hide();
this.Show();
}
示例13: PersonIndexForm
public PersonIndexForm(Form parent, Type type)
{
this.parent = parent;
this.type = type;
InitializeComponent();
InitPersonsList();
parent.Hide();
}
示例14: PersonDetailForm
public PersonDetailForm(Form parent, Type type)
{
this.parent = parent;
this.type = type;
InitializeComponent();
InitInputs();
parent.Hide();
}
示例15: changeFormToIndex
/// <summary>
/// 首页内容区域替换窗体接口
/// </summary>
/// <param name="needRplaceform">被替换的窗体</param>
/// <param name="replaceForm">替换的窗体</param>
public static void changeFormToIndex(Form needRplaceform, Form replaceForm)
{
replaceForm.TopLevel = false;
//添加目标窗体
needRplaceform.Parent.Controls.Add(replaceForm);
//移除被替换窗体
needRplaceform.Parent.Controls.Remove(needRplaceform);
replaceForm.Show();
needRplaceform.Hide();
}