Wrox Programmer Forums
|
BOOK: Stephens' Visual Basic Programming 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' Visual Basic Programming 24-Hour Trainer by Rod Stephens; ISBN: 978-0-470-94335-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' Visual Basic Programming 24-Hour Trainer 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 July 3rd, 2011, 11:00 PM
Authorized User
 
Join Date: May 2011
Posts: 46
Thanks: 27
Thanked 0 Times in 0 Posts
Default Exercise 10-2

After completing Ex 10-2 I decided to play with it. I added an interim form with 4 group boxes each with 3 radio buttons to give me a choice for the entries of the AcceptAgreementForm's text, icon (I pulled the image from my.resources), Accept button and Decline button. I set the default radio button for each group box and set the form's "accept button" to the OK button on the form (distinctive name and only button on the form). I displayed the form to check it but the OK button doesn't do anything!! Do the group boxes affect the form seeing the OK button? I used the same display code that I've used to display the other forms. I guess I'm getting ahead of the book again.

Code:
        '
        ' create the choice and dialog boxes
        '
        Dim chooseDialogEntriesDialog As New ChooseDialogEntriesForm
        Dim customMessageDialog As New CustomMessageForm
        '
        ' Initialize the choices and display the 'Choose' dialog
        '
        chooseDialogEntriesDialog.rdbLabelAcceptAgreement.Checked = True
        chooseDialogEntriesDialog.rdbLabelWell.Checked = False
        chooseDialogEntriesDialog.rdbLabelTakeYourPick.Checked = False
        chooseDialogEntriesDialog.rdbIconQuestion.Checked = False
        chooseDialogEntriesDialog.rdbIconQuestion2.Checked = False
        chooseDialogEntriesDialog.rdbIconQuestion3.Checked = True
        chooseDialogEntriesDialog.rdbOkAccept.Checked = True
        chooseDialogEntriesDialog.rdbOkOk.Checked = False
        chooseDialogEntriesDialog.rebOkIGuessSo.Checked = False
        chooseDialogEntriesDialog.rdbCancelCancel.Checked = False
        chooseDialogEntriesDialog.rdbCancelDecline.Checked = True
        chooseDialogEntriesDialog.rdbCancelNo.Checked = False

        If (chooseDialogEntriesDialog.ShowDialog() = Windows.Forms.DialogResult.OK) Then
            MessageBox.Show("Thanks for making your choices")
        End If
 
Old July 3rd, 2011, 11:21 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Did you set the OK button's DialogResult property to OK? That's the most likely problem.

If you don't do that, then you need to add an event handler to it to make it close the form in code.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
The Following User Says Thank You to Rod Stephens For This Useful Post:
zavodney (July 4th, 2011)
 
Old July 4th, 2011, 01:02 AM
Authorized User
 
Join Date: May 2011
Posts: 46
Thanks: 27
Thanked 0 Times in 0 Posts
Default

That was it! Thank you very much (said with a red face). Now I can go back to playing. It's amazing how much of an effect those little details have.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exercise 1.5 TallThunda BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 7 May 27th, 2013 04:37 PM
Chapter 10, listing 10-10-app kiwibrit BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 2 August 18th, 2009 04:21 AM
Please, could anyone help me with this exercise? java2007 Java Basics 3 December 10th, 2007 12:19 PM
Chapter 10 Enhanced File Info Display exercise err ssn651 BOOK: Beginning ASP 3.0 8 August 27th, 2003 10:35 AM





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