Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 3rd, 2011, 11:00 PM
Authorized User
Points: 195, Level: 3
Points: 195, Level: 3 Points: 195, Level: 3 Points: 195, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Location: Tennessee
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
Reply With Quote
  #2 (permalink)  
Old July 3rd, 2011, 11:21 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
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!)
Reply With Quote
The Following User Says Thank You to Rod Stephens For This Useful Post:
zavodney (July 4th, 2011)
  #3 (permalink)  
Old July 4th, 2011, 01:02 AM
Authorized User
Points: 195, Level: 3
Points: 195, Level: 3 Points: 195, Level: 3 Points: 195, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Location: Tennessee
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:50 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.