PC Review


Reply
Thread Tools Rate Thread

How can I make a form stay on top of my other forms?

 
 
Robin Tucker
Guest
Posts: n/a
 
      28th Oct 2004

How can I make my form stay on top of all the other forms in my application?
I don't want the form to stay on top in Windows as a whole, just be on top
of all the other forms in the given application instance.

Thanks,


Robin


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UnVsaW4gSG9uZw==?=
Guest
Posts: n/a
 
      28th Oct 2004
Use a timer to keep checking Me.ActiveForm:
Private myForm As New Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
If Me.ActiveForm Is Nothing Then
If Not (myForm Is Nothing OrElse myForm.IsDisposed) Then
myForm.TopMost = False
End If

Else
If Not (myForm Is Nothing OrElse myForm.IsDisposed) Then
myForm.TopMost = True
myForm.Show()
End If

End If
End Sub

I think maybe there is other way not to use timer.

 
Reply With Quote
 
steve
Guest
Posts: n/a
 
      28th Oct 2004

if i understand you right:
I had a similar question and this is the answer I got from Greg:

Dim f as new MyForm
If f.ShowDialog(Me) = DialogResult.OK Then
' do something
End If
f.Dispose()



I think myForm.showDialog(Me)
will also work

HTH
-steve

"Robin Tucker" <(E-Mail Removed)> a écrit dans le
message de news: clr20d$ski$1$(E-Mail Removed)...
>
> How can I make my form stay on top of all the other forms in my
> application? I don't want the form to stay on top in Windows as a whole,
> just be on top of all the other forms in the given application instance.
>
> Thanks,
>
>
> Robin
>



 
Reply With Quote
 
=?Utf-8?B?UnVsaW4gSG9uZw==?=
Guest
Posts: n/a
 
      28th Oct 2004
You can't work on other winForm if you use ShowDialog so that the application
is blocked by the dialog form.

"steve" wrote:

>
> if i understand you right:
> I had a similar question and this is the answer I got from Greg:
>
> Dim f as new MyForm
> If f.ShowDialog(Me) = DialogResult.OK Then
> ' do something
> End If
> f.Dispose()
>
>
>
> I think myForm.showDialog(Me)
> will also work
>
> HTH
> -steve
>
> "Robin Tucker" <(E-Mail Removed)> a écrit dans le
> message de news: clr20d$ski$1$(E-Mail Removed)...
> >
> > How can I make my form stay on top of all the other forms in my
> > application? I don't want the form to stay on top in Windows as a whole,
> > just be on top of all the other forms in the given application instance.
> >
> > Thanks,
> >
> >
> > Robin
> >

>
>
>

 
Reply With Quote
 
Robin Tucker
Guest
Posts: n/a
 
      28th Oct 2004
Yes, these are modeless forms.

"Rulin Hong" <(E-Mail Removed)> wrote in message
news:1DDEC55B-C3BB-415C-8B60-(E-Mail Removed)...
> You can't work on other winForm if you use ShowDialog so that the
> application
> is blocked by the dialog form.
>
> "steve" wrote:
>
>>
>> if i understand you right:
>> I had a similar question and this is the answer I got from Greg:
>>
>> Dim f as new MyForm
>> If f.ShowDialog(Me) = DialogResult.OK Then
>> ' do something
>> End If
>> f.Dispose()
>>
>>
>>
>> I think myForm.showDialog(Me)
>> will also work
>>
>> HTH
>> -steve
>>
>> "Robin Tucker" <(E-Mail Removed)> a écrit dans
>> le
>> message de news: clr20d$ski$1$(E-Mail Removed)...
>> >
>> > How can I make my form stay on top of all the other forms in my
>> > application? I don't want the form to stay on top in Windows as a
>> > whole,
>> > just be on top of all the other forms in the given application
>> > instance.
>> >
>> > Thanks,
>> >
>> >
>> > Robin
>> >

>>
>>
>>



 
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
Make a form stay always on top? =?Utf-8?B?UmljaGFyZCBIb3JuZQ==?= Microsoft Access Forms 4 11th Feb 2005 02:50 PM
Make Form stay on top until application is deactivated TC Microsoft Outlook Third-Party Utilities 16 19th Jan 2005 09:35 PM
Make Form stay on top until application is deactivated TC Microsoft Outlook Program Addins 16 19th Jan 2005 09:35 PM
Can I make a splitter stay centered using the Form designer Teis Draiby Microsoft Dot NET Framework Forms 4 14th Jan 2005 03:13 PM
How to make a form on the top of all forms? MJ Microsoft VB .NET 2 16th Dec 2003 01:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:09 PM.