Subject: Chapter 6 Try It Now Problem
Posted By: garak0410 Post Date: 2/8/2006 2:47:38 PM
Hello!

In the section on CONTROL FREAKS ARE GOOD, on # 4, I am having problems following the directions. Here's what it says:

"Two useful commands that you'll build the code for later in this book are not present. They are shortcuts to delete the currently selected person from the list and to enable the user to log off. Click on the ToolStrip to make it active and show the in-place editor. In the Type Here area, enter Delete and press Enter to save the new button.

Repeat this action and add a new button with a text label of Logoff."

When I click the toolbar, I don't get the TYPE HERE...only when I click on the main menu bar. Is this an error? If not, what am I doing wrong?

Thanks!


Reply By: MrAndyPuppy Reply Date: 2/18/2006 7:33:28 AM
Hi there,

Thank you so much for bringing this to my attention. In the very last build of Visual Basic Express, Microsoft changed the way toolbars work and we tried to get the changes into the manuscript. I will be writing up a full explanation of how to achieve this part of the walkthrough with the latest version of Visual Basic Express and will post it here as soon as possible.

Sorry you've hit this snag. To quickly get you past it, you can create a new button on the toolbar by clicking the inplace AddToolStripButton command on the toolbar. Right click on the icon that is displayed and change the DisplayStyle to Text. Now you can change the Text property in the Properties window to the string specified in the chapter. Repeat this process for the second button added to the toolbar.

Regards
Andrew
Reply By: Figgis Reply Date: 5/4/2006 7:58:04 AM
I came across that problem too. I did figure out how to get around it and created the buttons that were needed.

However within the same chapter I came across another problem. I have sent this through using the errata form but it may be worth mentioning here. The description that I sent is as follows:-

Page 117 step 3 of the Try it Out states within the With Statement that ".Anchor = AnchorStyles.Bottom + AnchorStyles.Right". When you enter this in Visual Basic 2005 Express states that this is a mistake and suggestes that it is changed to ".Anchor = CType(AnchorStyles.Bottom + AnchorStyles.Right, AnchorStyles)"

The odd thing is that the downloaded code for this book is exactly as the book states and it works fine. It wont work when I type it in. I thought this may have been due to a mistake that I had made but if it is I cant find it. I have been right back to the begining of the book and double checked everything I can find. Luckily when you accept the change that VB 2005 Express sugests it works fine however it is confusing for a beginer


Regards,

Figgis
Reply By: MrAndyPuppy Reply Date: 5/13/2006 9:23:19 AM
Hi Figgis,

Unfortunately the code downloaded is probably not exactly the way your own creation is. Some of the examples neglected to have the Option Strict setting turned on which allows some statements to compile successfully such as this one.

If you have Option Strict On, the line will not work and you will need to use the CType function to convert it to an AnchorStyles enumerated value.

This is because when you "add" two AnchorStyles enumeration values together, Visual Basic converts it implicitly to an Integer. Option Strict doesn't allow you to automatically convert an Interger back to an AnchorStyle enumerated value so you need to explicitly do it.

I am currently attempting to locate all the spots in the book where this kind of issue may pop up.

The CType change that Visual Basic suggests will work fine, or changing Option Strict to Off will also work.

Andrew

Reply By: Figgis Reply Date: 5/14/2006 6:36:42 PM
Andrew,

Many thanks for the reply. Does this mean that for each project you can have those options set differently? If we are to use the other projects do we have to check this out first?


Figgis

Go to topic 41588

Return to index page 287
Return to index page 286
Return to index page 285
Return to index page 284
Return to index page 283
Return to index page 282
Return to index page 281
Return to index page 280
Return to index page 279
Return to index page 278