Minggu, 02 Oktober 2011

Perbandingan Sampel



Contoh sederhana berikut menunjukkan kesamaan dalam sintaks antara VB dan VB.NET. Kedua contoh muncul kotak pesan yang mengatakan "Hello, World" dengan tombol OK.

Private Sub Command1_Click ()
     MsgBox "Hello, World"
end Sub


Sebuah contoh VB.NET, MsgBox atau kelas MessageBox dapat digunakan:

Public Class Form1
     Private Sub Button1_Click (ByVal sender Sebagai System.Object, ByVal e Sebagai System.EventArgs)Menangani Button1.Click
         MsgBox ("Hello, World")
     end Sub

akhir Kelas

Public Class Form1
     Private Sub Button1_Click (ByVal sender Sebagai System.Object, ByVal e Sebagai System.EventArgs)Menangani Button1.Click
         MessageBox.Show ("Hello, World")
     end Sub

akhir Kelas

Tidak ada komentar:

Posting Komentar