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

vb2005 app drops behind to background after clicking OK msgbox

I have a simple vb2005 app (for testing). It is just a simple winform with
one button that brings up a message box. When I invoke the app and click on
the button, the message box comes up OK. When I click a button on the
message box, the form and message box drop behind the IDE to the background.
The exe does the same thing. What can I do to keep the app from
dropping/falling to the background like that? Here is the code behind the
button.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Select Case MessageBox.Show("hello world from VB2005", "Testing",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button3, MessageBoxOptions.DefaultDesktopOnly, False)
Case Windows.Forms.DialogResult.Yes : MessageBox.Show("Yes")
Case Windows.Forms.DialogResult.No : MessageBox.Show("No")
Case Windows.Forms.DialogResult.Cancel : MessageBox.Show("Cancel")

End Select
End Sub

It is a very simple app, no imports no option strict, ...

Any suggestions appreciated.

Rich
Apr 20 '06 #1
1 2091
I added a second button to the form which brings up a simpler message box -
just an OK message box. This one works correctly. I click the button on the
form - it brings up the OK messagebox. I click OK on this message box and
the message box disappears and the form stays in view. The first button on
the form brings up a message box with 3 buttons - Yes, No, Cancel. When I
click any of those buttons, the messagebox and the form fall behind the IDE
to the background. Why does this message box cause that behavior but the 2nd
message box works OK?
Here is the code for the 2nd button:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
MessageBox.Show("Greetings", "Greetings", MessageBoxButtons.OK,
MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1,
MessageBoxOptions.RightAlign, True)
End Sub

"Rich" wrote:
I have a simple vb2005 app (for testing). It is just a simple winform with
one button that brings up a message box. When I invoke the app and click on
the button, the message box comes up OK. When I click a button on the
message box, the form and message box drop behind the IDE to the background.
The exe does the same thing. What can I do to keep the app from
dropping/falling to the background like that? Here is the code behind the
button.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Select Case MessageBox.Show("hello world from VB2005", "Testing",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button3, MessageBoxOptions.DefaultDesktopOnly, False)
Case Windows.Forms.DialogResult.Yes : MessageBox.Show("Yes")
Case Windows.Forms.DialogResult.No : MessageBox.Show("No")
Case Windows.Forms.DialogResult.Cancel : MessageBox.Show("Cancel")

End Select
End Sub

It is a very simple app, no imports no option strict, ...

Any suggestions appreciated.

Rich

Apr 20 '06 #2

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

Similar topics

3
by: Sergio Terenas | last post by:
Hi all, I've a Treeview control in a form load with 600 nodes. Each node has a text and tag associated to it at the time I add it. I need to find a node by either the text or the tag, make it...
7
by: guy | last post by:
Has anyone any experience of the conversion wizard for VB6 to VB2005? if so how good is it? also how does it handle database related conversions i.e is ADO converted to ADO.NET etc. the project...
0
by: hagar | last post by:
Hi all, I have a problem which I can not understand why this is happening! Debugging this I actually see that it grabs first record then when stepping through code to the line rsImportTo.AddNew...
9
by: ZikO | last post by:
Hi. I'm struggle with playing a wav in Visual Basic. First I wanted to use My.Computer.Audio.Play() method but I realized it's not working if I want to have music in background. I found in...
92
by: =?Utf-8?B?bW9iaWxlbW9iaWxl?= | last post by:
I'm trying to load this structure for a call to DeviceIoControl: typedef struct _NDISUIO_QUERY_OID { NDIS_OID Oid; PTCHAR ptcDeviceName; UCHAR Data; } NDISUIO_QUERY_OID, *PNDISUIO_QUERY_OID; ...
5
by: Galen Somerville | last post by:
My VB2005 program has a DataReciever thread that recieves data from an Activex VB6 thread. The data comes from a USB device that delivers 10 bit data in a series of bytes. So the low byte can be...
1
by: Jeffrey Christiansen | last post by:
I wanted to add a toggle button to a VB2005 form to be used for a simple Windows Application (i.e. compiled to a "*.exe"), so I added the ActiveX Microsoft Forms Object toggle button, however I...
5
by: Evolution445 | last post by:
Hi all, I got a problem with my code to check a game's chat position and write text to the game when a command is written by someone on the chat. I haven't figured out yet how to make it send keys...
8
rblaettler
by: rblaettler | last post by:
I have two div's with a float:left attribute that I've put into a list. They should align horizontally, which they do as long as the text in them does not need to be wrapped. As soon as the area for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.