Windows Forms: How to hide WinForm in C#
By FoxLearn 7/15/2017 7:12:56 PM 7.9K
How to hide a Windows Form after it run in C#
Step 1: Click New Project, then select Visual C# on the left, then Windows and then select Windows Forms Application. Name your project "HideApplication" and then click OK
Step 2: Open your form, then add code to Show and Load event handler as below
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Threading; namespace HideApplication { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Shown(object sender, EventArgs e) { //Hide your windows forms application this.Hide(); } private void Form1_Load(object sender, EventArgs e) { Thread.Sleep(5000);//5s MessageBox.Show("You can't see me !", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
VIDEO TUTORIALS
- Windows Forms: Advanced Filter DataGridView in C#
- Windows Forms: Progress Bar in C#
- How to create a Lucky Draw games in C#
- Windows Forms: Youtube Search with Paging in C#
- Windows Forms: How to Create a Random Password Generator in C#
- Windows Forms: Tag Control in C#
- Windows Forms: Wait Form Dialog in C#
- Windows Forms: Text to speech in C#