Skip to content Skip to sidebar Skip to footer

MessageBox Yes No


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2

{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Data yang dipilih di hapus...?", "peringatan", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
// action
}
try
{

}
catch (Exception ex)
{
MessageBox.Show("data gagal delete.\ndetail:\n" + ex.Message);
}
}
}

}
}


Post a Comment for "MessageBox Yes No"