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


C# Form.Hide方法代码示例

本文整理汇总了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;
         }
     }
 }
开发者ID:peterwillcn,项目名称:Avalon-nano,代码行数:34,代码来源:SafeControlUpdater.cs

示例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");
		}
开发者ID:GirlD,项目名称:mono,代码行数:28,代码来源:FormEventTest.cs

示例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.");
        }
开发者ID:ChadyG,项目名称:MUGE-GLEED2D,代码行数:25,代码来源:Game1.cs

示例4: Reserva

 public Reserva(Form parent, int opType)
 {
     this.parentForm = parent;
     this.operationType = opType;
     InitializeComponent();
     parent.Hide();
 }
开发者ID:ccantero,项目名称:gdatos_EnerLand,代码行数:7,代码来源:Reserva.cs

示例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();
 }
开发者ID:gcr,项目名称:super-sudoku-for-windows,代码行数:11,代码来源:GameManager.cs

示例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); }
        }
开发者ID:unscharf,项目名称:Gestion-de-casting,代码行数:34,代码来源:Usuarios.cs

示例7: mostrarNuevaVentana

 public static void mostrarNuevaVentana(Form ventanaNueva, Form ventanaPadre)
 {
     ventanaNueva.Visible = true;
     ventanaNueva.Activate();
     ventanaNueva.Select();
     ventanaPadre.Hide();
 }
开发者ID:julianSelser,项目名称:clinica,代码行数:7,代码来源:AsistenteVistas.cs

示例8: Logout

 public void Logout(Form currentForm)
 {
     currentForm.Hide();
     _appGlobal.Logout();
     Program.LoginForm.Show();
     currentForm.Dispose();
 }
开发者ID:bartreedijk,项目名称:TI2.1-RHAPP-IP,代码行数:7,代码来源:StandardForm.cs

示例9: SystemForm

 public SystemForm(Form previous,StreamReader reader, StreamWriter writer)
 {
     InitializeComponent();
     this.reader = reader;
     this.writer = writer;
     previous.Hide();
 }
开发者ID:hsnamr,项目名称:ARS-Client,代码行数:7,代码来源:SystemForm.cs

示例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();
        }
开发者ID:WinterGroveProductions,项目名称:Gleed2D,代码行数:31,代码来源:XnaGame.cs

示例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 );

     }     
    }
   }
  }
开发者ID:InTheSPOT,项目名称:creative-mode-plus,代码行数:59,代码来源:LoadSave.cs

示例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();
 }
开发者ID:ccantero,项目名称:gdatos_EnerLand,代码行数:9,代码来源:Dialog_Form.cs

示例13: PersonIndexForm

        public PersonIndexForm(Form parent, Type type)
        {
            this.parent = parent;
            this.type = type;
            InitializeComponent();
            InitPersonsList();

            parent.Hide();
        }
开发者ID:jodufra,项目名称:aulas_is,代码行数:9,代码来源:PersonIndexForm.cs

示例14: PersonDetailForm

        public PersonDetailForm(Form parent, Type type)
        {
            this.parent = parent;
            this.type = type;
            InitializeComponent();
            InitInputs();

            parent.Hide();
        }
开发者ID:jodufra,项目名称:aulas_is,代码行数:9,代码来源:PersonDetailForm.cs

示例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();
 }
开发者ID:269378737,项目名称:extractsystem,代码行数:15,代码来源:FormHelper.cs


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