简体   繁体   中英

Hiding a form from user in c# windows application

I have form, which i dont want the user to see it. "Dont ask me why :)"

I am using the following to achive it.

        this.ClientSize = new System.Drawing.Size(1, 1);
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        this.Name = "Logout";
        this.Opacity = 0;
        this.ShowInTaskbar = false;
        this.Text = "Logout";
        this.ResumeLayout(false);

But, when i press Alt + Tab it is showing the form in the list. I want to hide that too from the user. Possible ? How ? Thanks.

Okay, okay guys....i can share why... This is a logout form. Since the requirement is like logging out of application when the user pressed ctrl + Alt + Q, i need to use the KeyPress event handler which can be done only in a windows form. So i used a invisible form to achieve this. Got it..:) Thanks. Now please help me on this.

Hide Form from Alt+Tab

Ultimate question:

Why do you need this?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM