2 Replies - 550 Views - Last Post: 21 February 2010 - 11:03 AM Rate Topic: -----

#1 Jogan101  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 16-November 08

New to VB. Trying to create a simple Class

Posted 20 February 2010 - 03:18 PM

Hello everyone. I recently started working with Vb.net and I am just trying to create a class that has two properties one is StoreName and the other is StoreImage. What I am trying to do is figure out how to create objects using this class? Each object will be a Store that has a corresponding Name and Image to go with it. Here is the code I have written so far although I am not sure if im headed in the write direction with the function. Also not sure if it matters but I am using ASP with VB? Thanks for any help guys!
Imports Microsoft.VisualBasic

Public Class Store
    Dim NameofStore As String
    Dim ImageofStore As Image
    Public Property StoreName() As String
        Get
            Return NameofStore
        End Get
        Set(ByVal value As String)
            NameofStore = value
        End Set
    End Property

    Public Property StoreImage() As Image
        Get
            Return ImageofStore
        End Get
        Set(ByVal value As Image)
            ImageofStore = value
        End Set
    End Property

    Public Function GetStoreName() As String
        Select Case NameofStore
            Case "New York"
                Return "Tara Store - New York"
            Case "Chicago"
                Return "Tara Store - Chicago"
            Case Else
                Return ""
        End Select
        MsgBox(NameofStore)
    End Function

End Class



Is This A Good Question/Topic? 0
  • +

Replies To: New to VB. Trying to create a simple Class

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: New to VB. Trying to create a simple Class

Posted 20 February 2010 - 03:44 PM

You mean you're using ASP.NET with VB.NET right? Because you cannot do classic ASP with VB.NET.

Moved to ASP.NET :)
Was This Post Helpful? 0
  • +
  • -

#3 Jogan101  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 16-November 08

Re: New to VB. Trying to create a simple Class

Posted 21 February 2010 - 11:03 AM

View PostPsychoCoder, on 20 February 2010 - 02:44 PM, said:

You mean you're using ASP.NET with VB.NET right? Because you cannot do classic ASP with VB.NET.

Moved to ASP.NET :)


Yes sorry. Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1