9 Feb 2011

Menggunakan MessageBox Yes/No Buttons pada VB.Net

3:41 AM

Contoh pada Close Form
   
Private Sub Form1_FormClosing( _
    ByVal sender As System.Object, _
    ByVal e As System.Windows.Forms.FormClosingEventArgs) _
    Handles MyBase.FormClosing

    Dim message As String = _
            "Are you sure that you would like to close the form?"
    Dim caption As String = "Form Closing"
    Dim result = MessageBox.Show(message, caption, _
                                 MessageBoxButtons.YesNo, _
                                 MessageBoxIcon.Question)

    ' If the no button was pressed ...
    If (result = DialogResult.No) Then
        ' cancel the closure of the form.
        e.Cancel = True
    End If
End Sub

 
yach cukup. . . -_-' hehe 

Written by

Bukan seorang pakar ataupun praktisi profesional, hanya ingin berbagai atas esensi realita perjalanan dan mimpi yang terlihat tak bertepi.

0 komentar:

Posting Komentar

 

© 2014 Dipzt. All rights resevered. Designed by Templateism

Back To Top