Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Visual Basic Problem

  • 14-02-2007 12:45AM
    #1
    Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 Posts: 1,559 ✭✭✭quinnd6


    Brill thanks


Advertisement