By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

Application.Run forcing visibility

P: n/a
Hi there,

I'm having slight troubles using Application.Run and keeping a form
invisible. The method appears to force the visibility of the form even if I
override the createparams function with the following,

---------------

Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Const WS_VISIBLE As Integer = &H10000000
Dim pCPsParams As CreateParams = MyBase.CreateParams()
If ((Not showthisformflag) And CBool(pCPsParams.Style And
WS_VISIBLE)) Then pCPsParams.Style = pCPsParams.Style Xor WS_VISIBLE
Return (pCPsParams)
End Get
End Property

---------------

Ive tried changing the visibility in so many different places now and it
just does *not* work, even on activate with a static flag so it only happens
once. Any ideas on how to achieve this? Thanks loads in advance!

--
Nick Pateman

---------------------------------------------------------------
Please do not reply directly to me, but the entire newsgroup.
Any views expressed above are my own
Without predjudice
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
What about setting the Opacity property to 0%

?

"Nick" <no****@altavente.com> wrote in message
news:eP**************@TK2MSFTNGP09.phx.gbl...
Hi there,

I'm having slight troubles using Application.Run and keeping a form
invisible. The method appears to force the visibility of the form even if
I override the createparams function with the following,

---------------

Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Const WS_VISIBLE As Integer = &H10000000
Dim pCPsParams As CreateParams = MyBase.CreateParams()
If ((Not showthisformflag) And CBool(pCPsParams.Style And
WS_VISIBLE)) Then pCPsParams.Style = pCPsParams.Style Xor WS_VISIBLE
Return (pCPsParams)
End Get
End Property

---------------

Ive tried changing the visibility in so many different places now and
it just does *not* work, even on activate with a static flag so it only
happens once. Any ideas on how to achieve this? Thanks loads in advance!

--
Nick Pateman

---------------------------------------------------------------
Please do not reply directly to me, but the entire newsgroup.
Any views expressed above are my own
Without predjudice

Nov 21 '05 #2

P: n/a
"Nick" <no****@altavente.com> schrieb:
I'm having slight troubles using Application.Run and keeping a form
invisible. The method appears to force the visibility of the form even if
I override the createparams function with the following,


You can use 'Application.Run()' (parameterless version) to start a message
loop without showing a form.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
Hi there,

That's quite a mad one I hadn't thought of, what I've ended up doing is
creating a new visible flag for the form and exposing it as a property. The
when the visiblechanged event on the form fires I set the forms visibility
property to me custom flag. Even though the event seems to get fired about
3 times to start with this seems to work pretty well. Thanks for your idea
though, thinking outside the box huh?

Cheers again :-)

Nick.

"Mr Newbie" <he**@now.com> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
What about setting the Opacity property to 0%

?

"Nick" <no****@altavente.com> wrote in message
news:eP**************@TK2MSFTNGP09.phx.gbl...
Hi there,

I'm having slight troubles using Application.Run and keeping a form
invisible. The method appears to force the visibility of the form even
if I override the createparams function with the following,

---------------

Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Const WS_VISIBLE As Integer = &H10000000
Dim pCPsParams As CreateParams = MyBase.CreateParams()
If ((Not showthisformflag) And CBool(pCPsParams.Style And
WS_VISIBLE)) Then pCPsParams.Style = pCPsParams.Style Xor WS_VISIBLE
Return (pCPsParams)
End Get
End Property

---------------

Ive tried changing the visibility in so many different places now and
it just does *not* work, even on activate with a static flag so it only
happens once. Any ideas on how to achieve this? Thanks loads in
advance!

--
Nick Pateman

---------------------------------------------------------------
Please do not reply directly to me, but the entire newsgroup.
Any views expressed above are my own
Without predjudice


Nov 21 '05 #4

P: n/a
Hi Herfried,
I'm having slight troubles using Application.Run and keeping a form
invisible. The method appears to force the visibility of the form even
if I override the createparams function with the following,


You can use 'Application.Run()' (parameterless version) to start a message
loop without showing a form.


I've come up with a different method, mentioned in the post to "Mr
Newbie". Im slightly curious where the message loops is processed for the
parameterless Application.Run()? If there is no form attached to it how can
you start an application? does execution continue but not quit until the
loop is stopped? I should have a try at it really, thanks for the advice
Herfried :-)

Nick.
Nov 21 '05 #5

P: n/a
Mad Idea Eh!,
;-}


"Nick" <no****@altavente.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... Hi there,

That's quite a mad one I hadn't thought of, what I've ended up doing is
creating a new visible flag for the form and exposing it as a property.
The when the visiblechanged event on the form fires I set the forms
visibility property to me custom flag. Even though the event seems to get
fired about 3 times to start with this seems to work pretty well. Thanks
for your idea though, thinking outside the box huh?

Cheers again :-)

Nick.

"Mr Newbie" <he**@now.com> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
What about setting the Opacity property to 0%

?

"Nick" <no****@altavente.com> wrote in message
news:eP**************@TK2MSFTNGP09.phx.gbl...
Hi there,

I'm having slight troubles using Application.Run and keeping a form
invisible. The method appears to force the visibility of the form even
if I override the createparams function with the following,

---------------

Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Const WS_VISIBLE As Integer = &H10000000
Dim pCPsParams As CreateParams = MyBase.CreateParams()
If ((Not showthisformflag) And CBool(pCPsParams.Style And
WS_VISIBLE)) Then pCPsParams.Style = pCPsParams.Style Xor WS_VISIBLE
Return (pCPsParams)
End Get
End Property

---------------

Ive tried changing the visibility in so many different places now and
it just does *not* work, even on activate with a static flag so it only
happens once. Any ideas on how to achieve this? Thanks loads in
advance!

--
Nick Pateman

---------------------------------------------------------------
Please do not reply directly to me, but the entire newsgroup.
Any views expressed above are my own
Without predjudice



Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.