Wrox Programmer Forums
Beginning Visual Basic 2015
This is the forum to discuss the Wrox book Beginning Visual Basic 2015 by Bryan Newsome; ISBN: 978-1-119-09211-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning Visual Basic 2015 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 January 31st, 2016, 05:39 PM
Registered User
Join Date: Jan 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default Using Enumerations

Hey there!

I have a question that I'm struggling to find an answer for on the Using Enumerations Try It Out.

Here is the code:

 'Hour Property
    Private Property Hour() As Integer
            'Return the current hour displayed
            Return dtpHour.Value.Hour
        End Get
        Set(value As Integer)
            'Set the date using the hour passed to this property
            dtpHour.Value = New Date(Now.Year, Now.Month, Now.Day, value, 0, 0)
            'Set the display label
            lblState.Text = "At " & value & ":00, Richard is "

        End Set
    End Property
Question 1:

Between the Get tags, the comment says 'Return the current hour displayed.

I'm assuming this the hour displayed as set when the program runs as I'm returning the Hour value of the dtpHour object. Am I correct on this?

Question 2:

Between the set tags, the comments says: 'Set the date using the hour passed to this property

Is the date being passed to this property, the date being set by the user when the program is being run (as he changes the date / time)?



Last edited by sapper; January 31st, 2016 at 05:43 PM..

Similar Threads
Thread Thread Starter Forum Replies Last Post
Enumerations Will BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 9 June 23rd, 2010 01:41 PM
Help with Enumerations iansummers VB.NET 3 July 9th, 2007 05:01 PM
Chapter 5: Enumerations Richard Stringfellow BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 3 December 5th, 2006 10:46 PM
Chapter 5: Enumerations Richard Stringfellow Visual Basic 2005 Basics 0 December 2nd, 2006 01:28 PM
Enumerations JAL C# 2 November 20th, 2005 10:49 AM

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