PC Review


Reply
Thread Tools Rate Thread

Application.Run forcing visibility

 
 
Nick
Guest
Posts: n/a
 
      20th Sep 2005
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


 
Reply With Quote
 
 
 
 
Mr Newbie
Guest
Posts: n/a
 
      20th Sep 2005
What about setting the Opacity property to 0%

?

"Nick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      20th Sep 2005
"Nick" <(E-Mail Removed)> 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/>

 
Reply With Quote
 
Nick
Guest
Posts: n/a
 
      20th Sep 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> What about setting the Opacity property to 0%
>
> ?
>
> "Nick" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>

>
>



 
Reply With Quote
 
Nick
Guest
Posts: n/a
 
      20th Sep 2005
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.


 
Reply With Quote
 
Mr Newbie
Guest
Posts: n/a
 
      21st Sep 2005
Mad Idea Eh!,

>>;-}



"Nick" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> What about setting the Opacity property to 0%
>>
>> ?
>>
>> "Nick" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Random File Visibility Dave Denmark Windows XP Security 1 17th Feb 2005 08:39 PM
Re: Random File Visibility Mark L. Ferguson Windows XP Help 0 17th Feb 2005 01:30 PM
RE: Random File Visibility =?Utf-8?B?UGhpbCBBZ2Nhb2lsaQ==?= Windows XP Security 0 17th Feb 2005 04:17 AM
Limit memory visibility FreePalestine Windows XP Performance 3 24th Oct 2003 10:45 AM
One-way network? -- lost visibility in other direction KyColonel Windows XP Networking 2 15th Jul 2003 11:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:42 PM.