开发者

Is it possible to use a form without its being visible to user?

开发者 https://www.devze.com 2023-03-24 16:59 出处:网络
I\'ll explain: i have a form that i want to use it from another application. but the commands are using the buttons on the form which i want 开发者_StackOverflow社区it to be invisible to user (which s

I'll explain: i have a form that i want to use it from another application. but the commands are using the buttons on the form which i want 开发者_StackOverflow社区it to be invisible to user (which sends messages to another target etc).


I think that you want to use the code behind of the Form without actually showing it. You should try refactoring your code in a separate class which you can use for your purpose.


Before call other application, just hide it

Private void MakeInvisible()
{
    this.Hide();

    // application call code

}

Thank you


You could try to move the Form beyond the visible area of the display. E.g., set its Location to (-1024,0) Unless the user has multiple displays.


You should be using classes if you don't need to have the form invisible.

    this.Opacity = 0;
    this.ShowInTaskBar = false;
0

精彩评论

暂无评论...
验证码 换一张
取 消