|
-
Sep 1st, 2005, 05:21 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Msgbox v MessageBox
Ok another one of these which is better and why choose one over the other threads.
Is there any big difference between the Msgbox and MessageBox.
from what i can see the messagebox has a lot more options to it, but the Msgbox for me is just that much more simpler.
Also i've noticed that after you do a messagebox.show i try set focus to a control after but it does not focus to the control
whats everyone else view?
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Sep 1st, 2005, 06:47 AM
#2
Re: Msgbox v MessageBox
MsgBox is part of the Microsoft.Compatibility namespace as it came from VB6.
MessageBox is the .NET class and it has more features.
You should try to use the MessageBox class wherever possible.
-
Sep 1st, 2005, 06:49 AM
#3
Thread Starter
Fanatic Member
Re: Msgbox v MessageBox
MessageBox.Show("there is an erro", "Mytitle", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
textbox1.focus
textbox1.selectall
however the focus and the select all does not work with the messagebox, whereas it does with msgbox
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Sep 1st, 2005, 07:19 AM
#4
PowerPoster
Re: Msgbox v MessageBox
 Originally Posted by Strider
MessageBox.Show("there is an erro", "Mytitle", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
textbox1.focus
textbox1.selectall
however the focus and the select all does not work with the messagebox, whereas it does with msgbox
Hi,
Works OK for me. (I cut & pasted your code)
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Sep 1st, 2005, 07:25 AM
#5
Thread Starter
Fanatic Member
Re: Msgbox v MessageBox
hmmm it does now for me, that didnt a few mins ago... ah well
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Sep 1st, 2005, 08:05 AM
#6
Re: Msgbox v MessageBox
 Originally Posted by tr333
MsgBox is part of the Microsoft.Compatibility namespace as it came from VB6.
MessageBox is the .NET class and it has more features.
You should try to use the MessageBox class wherever possible.
MsgBox has nothing to do with the Microsoft.Comapatibility namespace, which is provided only for the use of the VB6 upgrade wizard in order to allow certain things in VB6 that do not have .NET equivalents to still work when upgraded. MsgBox is a function from the Microsoft.VisualBasic namespace, which includes fully .NET implementations of functions that provide the same functionality as similarly named functionsn that exist in VB6. MsgBox and MessageBox.Show have essentially the same functionality because MsgBox actually calls MessageBox.Show itself. There is next to no difference between the two performance-wise as well, except that there is really no point making the extra function call when you don't have to. In short, there is no reason not to use MessageBox.Show. It is just that VB6 developers are already comfortable with MsgBox and are reluctant to change without a compelling reason, and there really is no compelling reason.
-
Sep 1st, 2005, 09:05 AM
#7
PowerPoster
Re: Msgbox v MessageBox
 Originally Posted by Strider
hmmm it does now for me, that didnt a few mins ago... ah well
No worries. My wife often says that to me
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|