Wrox Programmer Forums
|
BOOK: Visual Basic 2005 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2005 Programmer's Reference by Rod Stephens; ISBN: 9780764571985
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2005 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 15th, 2006, 02:10 PM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default messagebox.show does not exist

on page 105 of the book it shows how to use messagebox.show, this object no longer exists in 2005, it's gone back to msgbox(prompt,buttons,title) as integer the way it was in 6.

may be nit picking, just got the book today, but stood out as i have had this issue.

tap dancing on the brittle edge of sanity
 
Old June 16th, 2006, 09:01 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

MessageBox.Show is still around. Most VB .NET developers use it instead of MsgBox because it feels "more object-oriented" although you can use either.

MsgBox is a Visual Basic "Classic" function so it's provided for backwards compatibility in the Microsoft.VisualBasic namespace.

But MessageBox.Show is the "true" .NET way to do things. In particular, a C# programmer probably wouldn't have the Microsoft.VisualBasic namespace imported so he wouldn't be able to use MsgBox without some additional effort.

The MessageBox class is in the System.Windows.Forms namespace so you won't see it if you make a console application, class library, or other applicaion that normally doesn't include this library. You will see it in a Windows Forms application or a control library.

If you don't see it, open Project Explorer and double-click My Project. On the References tab, click the Add button, and select the System.Windows.Forms library. Then don't forget to add "Imports System.Windows.Forms" to your code.

I hope that helps.


Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
messagebox.show bikki_suresh ASP.NET 1.0 and 1.1 Basics 3 March 20th, 2008 04:26 AM
Using messagebox.show() leion General .NET 17 March 20th, 2008 01:39 AM
MessageBox.Show() jyoti_khera General .NET 2 November 23rd, 2004 06:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.