using Windows.UI.Popups;
MessageDialog msgDialog = new MessageDialog("Your message", "Your title"); msgDialog.ShowAsync();
private void Button_Click(object sender, RoutedEventArgs e) { MessageBox("Your Message"); } protected async void MessageBox(string msg) { // using Windows.UI.Popups; var msgDlg = new MessageDialog(msg); msgDlg.DefaultCommandIndex = 1; await msgDlg.ShowAsync(); }
private void Button_Click(object sender, RoutedEventArgs e) { MessageDialog msgDialog = new MessageDialog("Your message", "Your title"); msgDialog.ShowAsync(); }
private void Button_Click(object sender, RoutedEventArgs e) { MessageDialog msgDialog = new MessageDialog("Your message", "Your title"); //OK Button UICommand okBtn = new UICommand("OK"); okBtn.Invoked = OkBtnClick; msgDialog.Commands.Add(okBtn); //Cancel Button UICommand cancelBtn = new UICommand("Cancel"); cancelBtn.Invoked = CancelBtnClick; msgDialog.Commands.Add(cancelBtn); //Show message msgDialog.ShowAsync(); } private void CancelBtnClick(IUICommand command) { } private void OkBtnClick(IUICommand command) { }
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท