CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    May 2008
    Posts
    31

    [RESOLVED] Creat Property in th CLass

    This is a class with property.

    Code:
     
    Public Class classDate
    Private m_BirthDate As Date
    Property BirthDate() As Date
    Get
    Return m_BirthDate
    End Get
    Set(ByVal Value As Date)
    m_BirthDate = Value
    End Set
    End Property
    End Class
    ----
    Dim D As New classDate
    D.BirthDate = "1 / 10 / 2008"
    MsgBox(D.BirthDate)
    Which line is realted to Get and which line rleated to Set?
    it's mean is this line related to Set
    D.BirthDate = "1 / 10 / 2008"

    and this line to Get
    MsgBox(D.BirthDate)


  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Creat Property in th CLass

    1) Please dont use tiny fonts..stick with the defaults.
    2) Is there a question here?
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Jan 2006
    Location
    Pearl of the orient
    Posts
    304

    Re: Creat Property in th CLass

    Quote Originally Posted by nader View Post
    Which line is realted to Get and which line rleated to Set?
    it's mean is this line related to Set
    D.BirthDate = "1 / 10 / 2008"

    and this line to Get
    MsgBox(D.BirthDate)

    Aren't they self-explanatory?

  4. #4
    Join Date
    May 2008
    Posts
    31

    Re: Creat Property in th CLass

    Waht is Set doing, and what is Get doing?

  5. #5
    Join Date
    Nov 2008
    Location
    United States
    Posts
    81

    Re: Creat Property in th CLass

    Quote Originally Posted by nader View Post
    Waht is Set doing, and what is Get doing?
    Set is setting.
    Get is getting.
    Three5Eight
    Using: MS C# 08 EE, MS SQL 05 EE, C++ .Net 08 EE, Vista Home Premium, XP Home

  6. #6
    Join Date
    Jan 2006
    Location
    Pearl of the orient
    Posts
    304

    Re: Creat Property in th CLass

    Did you get what is set by Three5Eight?

  7. #7
    Join Date
    May 2008
    Posts
    31

    Re: Creat Property in th CLass

    Do you mean the Get is read the property as in
    MsgBox(D.BirthDate)

  8. #8
    Join Date
    Jan 2006
    Location
    Pearl of the orient
    Posts
    304

    Re: Creat Property in th CLass

    Yes, that is getting the BirthDate.

    And this is setting the birthdate.

    Code:
    D.BirthDate = "1/10/2008"

  9. #9
    Join Date
    May 2008
    Posts
    31

    Re: Creat Property in th CLass

    That's What I have asked before in POst 1
    Thank you for heLP!

  10. #10
    Join Date
    Jan 2006
    Location
    Pearl of the orient
    Posts
    304

    Re: [RESOLVED] Creat Property in th CLass

    And you were correct all along.

  11. #11
    Join Date
    May 2008
    Posts
    31

    Re: [RESOLVED] Creat Property in th CLass

    thank you again!

  12. #12
    Join Date
    Nov 2008
    Location
    United States
    Posts
    81

    Re: Creat Property in th CLass

    Quote Originally Posted by dee-u View Post
    Did you get what is set by Three5Eight?
    lol
    Three5Eight
    Using: MS C# 08 EE, MS SQL 05 EE, C++ .Net 08 EE, Vista Home Premium, XP Home

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured