How to hide my SmartDevice application on startup?

笑着哭i 提交于 2019-12-20 03:38:10

问题


I made a SmartDevice application that runs on startup and I want it to be hidden at first launch.

I've tried this.Hide(), this.Visible = false and ShowWindow(Handle, SW_HIDE) in Form Load() event and InitializeComponent() with no luck.

Any help will be appreciated.


回答1:


The CF automatically calls Show on the Form passed to Application.Run. There is no avoiding that without avoiding the call to Application.Run.

The SDF has an Application2.Run that takes a parameter to tell it to not show the form.

You could do the same by creating your own message pump (though it's not a straightforward thing to do).




回答2:


declare two global vars :

int32 VGU_Left;
int32 VGU_Top;

in the on create of the form object :

VGU_Left=this.left;
VGU_Top=this.top;
this.left=this.width*-1;
this.top=this.height*-1;

and when you want to show the form :

if ((this.left<0)and(this.top<0)) then 
  this.left=VGU_Left;
  this.top=VGU_Top;
endif


来源:https://stackoverflow.com/questions/2533266/how-to-hide-my-smartdevice-application-on-startup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!