473,378 Members | 1,375 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,378 software developers and data experts.

Messagebox shows underneath a TopMost form

Hello,

I've seen a couple previous posts about this phenomenon, but none seem
to have been resolved. I am using Visual Basic .NET 2003 on Windows
2000 SP 3.

Would you mind creating a new project and running this simple test
program to see if it happens to you? Please let me know if you have
any ideas for a workaround (other than setting the TopMost form to
False then back to True every time I show a MessageBox.)

Create a new project and add the following code:

'------------------------
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized

Dim objForm As New Form
With objForm
.Text = "I'm the new form"
.TopMost = True
.StartPosition = FormStartPosition.CenterScreen
.Show()
End With
End Sub

Private Sub Form1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Click
MessageBox.Show("I get shown underneath " & _
"the new TopMost form and you can't see me.")
End Sub
'------------------------

Just start the app and click Form1. I made the message text wide
enough so the MessageBox extends past the default size of the new
form, but if it is smaller that makes things messier.
Nov 20 '05 #1
1 6039
* Ju************@yahoo.com (Kevin) scripsit:
I've seen a couple previous posts about this phenomenon, but none seem
to have been resolved. I am using Visual Basic .NET 2003 on Windows
2000 SP 3.


This behavior is "by design". Quick and Dirty solution (I didn't check
the side effects):

\\\
MsgBox("I get shown underneath " & _
"the new TopMost form and you can't see me.", MsgBoxStyle.SystemModal)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

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

Similar topics

0
by: Sajjadul Hakim | last post by:
Hello Everyone, When i add a DataGrid to a form, the TopMost property of the form becomes invalid; i.e. even if the TopMost property is set to "true" the form does not stay on top of other...
3
by: Hovhannes Asatryan | last post by:
Hello guys. I have a problem with a topmost form. I am writting in C#. I have Mdi Form wich has 2 child forms. I want to set one of them as a topmost window, but when I sets MdiParent the...
10
by: Russ | last post by:
I've been trying to figure out how to show a simple messagebox with an OK button in my web client program (C#). I have looked at every reference to JScript and MessageBox that seemed even remotely...
12
by: E Goforth | last post by:
Hello, I have a VB6 app that calls a VB.NET app via named pipes and a third party component. Inside the VB.NET app I'm trying to force a form to the top, at least temporarily. Inside a form's...
2
by: Max | last post by:
Hello, My VB.NET application displays a Windows form in a panel on my main form. While my application has the focus, I want the form in the panel to have the "topmost" position, even if it is...
6
by: Strahimir Antoljak | last post by:
I'm running VS.NET 2002 and keep having problems with form keeping on top with its TopMost property. Sometimes my program places the invoked form on top sometimes not. Sometimes when I click on the...
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 "=...
3
by: Dean Slindee | last post by:
Anyone know of a source project for inheriting from the current MessageBox or a new form that performs most or many of these design requirements: '1. handle 2-4 buttons as needed, including default...
1
by: gewe | last post by:
I have a form (sizeable border, shows in taskbar, nothing unusual), which is the main form of my application (called MainForm). During an operation progress is shown in another form, that is shown...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.