473,394 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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


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
Nov 21 '05 #1
4 1536
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.

Nov 21 '05 #2

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" <id*************************@reallyidont.com> a écrit dans le
message de news: cl*******************@news.demon.co.uk...

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

Nov 21 '05 #3
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" <id*************************@reallyidont.com> a écrit dans le
message de news: cl*******************@news.demon.co.uk...

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


Nov 21 '05 #4
Yes, these are modeless forms.

"Rulin Hong" <Ru*******@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
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" <id*************************@reallyidont.com> a écrit dans
le
message de news: cl*******************@news.demon.co.uk...
>
> 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
>


Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ChrisR | last post by:
Hi all Ive have a Main Form with Command Buttons down the Left hand side, that open various forms. Clicking on a button opens a Sub Form which is moved to take up 3/4s of the right of the main...
3
by: jaYPee | last post by:
I have a form (dialog form to display report) that has an unbound textbox. I want to pass the value of this textbox to my report. But how can I pass this value if i'm accessing SQL Server 2000...
3
by: MLH | last post by:
I have a form, bound to a query. Its RecordSource property is a query named frmEnterLienAmounts. The form has a few bound controls and some unbound controls. The unbound controls are calculated...
2
by: Krzysztof Karnicki | last post by:
I would like develop Form on my Windows Application, that is going to notify the user, just like Microsoft Office 2003 shows that there are new mail coming. When I use System.Windows.Forms.Form and...
6
by: Jonathan | last post by:
Hi, I have a parent(container) form which opens another form, and that one opens another etc.., each form is open with Form.MdiParent = Me.MdiParent. (apart from the first one which is just "=...
8
by: Stephen Rice | last post by:
Hi, I have a periodic problem which I am having a real time trying to sort. Background: An MDI VB app with a DB on SQL 2000. I have wrapped all the DB access into an object which spawns a...
4
by: kaosyeti | last post by:
what's the best way to get a form to always open at a specific size. i've sized and saved the forms, changed the borders and had popup on and off all over but can't seem to get it to stay one way...
1
by: nkoriginal | last post by:
Hello Again: I've a problem with my forms. I woking with an intranet, and the pages in that intranet, has a reload page, every 10 minutos. So my problems star, when any user stay in my forms...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get the value of a form control? -----------------------------------------------------------------------...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.