Wrox Programmer Forums
|
BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-8
This is the forum to discuss the Wrox book Wrox's Visual Basic 2005 Express Edition Starter Kit by Andrew Parsons; ISBN: 9780764595738
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-8 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 August 16th, 2006, 03:23 PM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Bug in Chapter 5 Personal Organizer

I made changes to the Personal Organizer program as directed by the book and everything worked as the book said that it would. However, I discovered that if I clicked the "Show List" or "Add Person" buttons more than once before clicking the other button then the program would not display the new control (behaved much like it did prior to step 10 in the try it out).

I'm still green enough in VB 2005 that I don't know why this is happening but I did discover how to prevent it; simply nest the code for each button within another If..Then statement. For the Show List button it would look like this:

If objPersonList Is Nothing Then
     code as written in the book
End If

If a similar addition is made to the Add Person button's code then each button can be clicked as many times as you want before the other button is clicked and everything will behave normally.

 
Old September 30th, 2006, 12:53 PM
Registered User
 
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

And where must i placed that code exactly?? tryed several times but can't get it to work.

Regards,
Henk

All the best,
Henk.
 
Old October 10th, 2006, 10:52 AM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Henk,

I've gotten rid of my book and deleted all of the examples that I had out of frustration so this is coming strictly from memory. For the code that I mentioned at the start of this thread I started off with the code exactly as is shown in the book. I then opened up the user interface and double clicked on the button (Show List for this example). This opens up the code viewer right at the point for the code for that button. Right below the "Private Sub . . ." line is where I put the If ..Then statement. I put the End If between the end of the book's code and the "End Sub" line. I then went back to the user interface, double clicked the Add Person button, and added a similar If..Then to that code as well.

As you have probably already found out from the other messages on this board there are a lot of problems with the project presented in this book. This code won't fix any of those problems; it's just something to address a small bug that I found. I recommend forgetting about this book and getting a copy of Microsoft Visual Basic 2005 Step by Step which is written by Michael Halvorson. I had a much easier time with this book and after reading it I was able to write a program for use at my job.

 
Old September 9th, 2007, 12:50 PM
Cry Cry is offline
Registered User
 
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

just put pnlMain.Controls.Clear() in place of the entire IF statement of BOTH buttons....


For all you morons that need to trash the authors minor mistake because you're to "stupider" to BE A PROGRAMMER AND figure out what he did wrong..(or the way to fix it with the above line)...HERE IT IS IN EXAMPLE FORM:

    Private Sub btnAddPerson_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddPerson.Click
        objPersonalDetails = New PersonalDetails
        pnlMain.Controls.Clear()
        pnlMain.Controls.Add(objPersonalDetails)
        objPersonalDetails.Dock = DockStyle.Fill
    End Sub

dang posers....

FYI: Not ever even attempting to program before, I am finding the book relatively easy to follow, and a vast source of knowledge and fun.

Lawrence








Similar Threads
Thread Thread Starter Forum Replies Last Post
bug in exercise 2 in chapter 1? swartout BOOK: Beginning Mac OS X Programming 4 May 6th, 2007 09:40 PM
Bug or no to bug learning C using VS.Net to compil tesh All Other Wrox Books 0 February 14th, 2007 01:06 PM
Retrieving email address of organizer dotnetprogrammer VS.NET 2002/2003 0 March 29th, 2005 03:16 AM





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