Variabel Global dan Private




















Public Class Form1
    Public x As Byte
    Public y As Byte


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        x = 3
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = x
        y = 4
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim x As Byte = 10
        TextBox2.Text = x + y

    End Sub
End Class

Share this

Related Posts

Previous
Next Post »

Terimakasih Atas Komentar Anda....!!! :) EmoticonEmoticon