Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Visual Basic Problem

Options
  • 14-02-2007 12:45am
    #1
    Registered Users Posts: 1,552 ✭✭✭


    Please Help me with this errors problem

    Ive created a class which supposed to change the height of a picturebox on a form but it wont work cos I get these errors

    Error 2 Value of type 'Integer' cannot be converted to '1-dimensional array of Integer'.

    Error 3 'Set' parameter must have the same type as the containing property.

    It has problems with return intHeight
    and Value in Set(ByVal Value as integer)
    This is the code I used


    Public Class changeHeightWidth
    Private intHeight As Integer

    Public Property ChangeHeight() As Integer()
    Get
    Return intHeight
    End Get


    Set(ByVal Value As Integer)
    intHeight = Value
    End Set

    End Property
    End Class


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    
    Public Class changeHeightWidth
    Private intHeight As Integer
    
    [b]Public Property ChangeHeight() As Integer[/b]
    Get
    Return intHeight
    End Get
    
    
    Set(ByVal Value As Integer)
    intHeight = Value
    End Set
    
    End Property
    End Class
    

    Public Property ChangeHeight() As Integer() is declaring the property as an array. I've removed the parentheses in the code above - that should fix it for you.


  • Registered Users Posts: 1,552 ✭✭✭quinnd6


    Brill thanks


Advertisement