Saturday 7 June 2014

program 19: get & set method

program to change height and width of image using get () and set () property.
-----------------------------------------code---------------------------------------------------------
Public Class Class1
    Public hei, wid As Integer
    Public Property height() As Integer
        Get
            Return hei
        End Get
        Set(ByVal value As Integer)
            hei = value
        End Set
    End Property
    Public Property width() As Integer
        Get
            Return wid
        End Get
        Set(ByVal value As Integer)
            wid = value
        End Set
    End Property
End Class

Public Class Form1
    Dim b, c As Integer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a As New Class1
        a.height = Val(TextBox1.Text)
        a.width = Val(TextBox2.Text)
        b = a.height
        c = a.width
        PictureBox1.Height = b
        PictureBox1.Width = c
    End Sub
End Class
Sonata Ocean Analog Watch - For Men(Black)
-----------------------------------------output----------------------------------------------------


umesh sohaliya
codestrew

No comments:

Post a Comment