473,769 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Select Case MessageBox.Show ("hello world from VB2005", "Testing",
MessageBoxButto ns.YesNoCancel, MessageBoxIcon. Exclamation,
MessageBoxDefau ltButton.Button 3, MessageBoxOptio ns.DefaultDeskt opOnly, False)
Case Windows.Forms.D ialogResult.Yes : MessageBox.Show ("Yes")
Case Windows.Forms.D ialogResult.No : MessageBox.Show ("No")
Case Windows.Forms.D ialogResult.Can cel : 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 2108
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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
MessageBox.Show ("Greetings" , "Greetings" , MessageBoxButto ns.OK,
MessageBoxIcon. Asterisk, MessageBoxDefau ltButton.Button 1,
MessageBoxOptio ns.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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Select Case MessageBox.Show ("hello world from VB2005", "Testing",
MessageBoxButto ns.YesNoCancel, MessageBoxIcon. Exclamation,
MessageBoxDefau ltButton.Button 3, MessageBoxOptio ns.DefaultDeskt opOnly, False)
Case Windows.Forms.D ialogResult.Yes : MessageBox.Show ("Yes")
Case Windows.Forms.D ialogResult.No : MessageBox.Show ("No")
Case Windows.Forms.D ialogResult.Can cel : 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
9642
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 the SelectedNode and then make sure it's visible on the tree. I've been playing with the treeview's properties/methods but I think I got stuck. Dim aKey As String = txtKey.Text Dim a As Integer
7
3841
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 is approx 60 forms with so approx 180 to 240 classes The back end was and remains S!L Server 2000
0
4111
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 it drops first record and grabs second record and continues on no problems (but no 1st record in data set) I am reading a text file record 1 is a top of text file. see code below Private Sub CmdFetchNewData_Click() on Error Goto CmdfetchErr Dim...
9
3600
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 internet SoundPlayer Class but unfortunately I can't find it in my Visual Studio Application. Whenever I try to use it Dim Player New SoundPlayer ...
92
3344
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; I created the equivalent in VB:
5
1456
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 0 to 255 but the high byte can only be 0 to 4. What's happening is that quite often a zero high byte becomes 255 after it goes through shared memory. The bytes are in groups of 24 bytes.
1
4439
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 can't get this button does work properly. The documentation I found in the FM20.CHM files says the button state can be determined from its "Value" property, but the property list shown in VB2005 does not have a "Value" property. How is the button...
5
2926
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 to the gamewindow when it's not focussed, and WriteProcessMemory, but that's for a later issue. This is my current code: Public Const PROCESS_ALL_ACCESS As Long = &H1F0FFF Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As...
8
5590
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 the float gets too small, IE wraps the text, but FF drops the div below the other before it starts to wrap the text. This is not exactly what I want. I could use absolute positioning, but that leads to other issues and is not really what I wanna do...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10212
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9995
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.