2019년 8월 30일 금요일

[C#/Mono] Dialog


wDialog.cs



using System;
using System.Drawing;
using System.Windows.Forms;

public class WDialog : WCtrl
{
 public WDialog() {
 }
 
 public static void ok(string title, string message) {
  MessageBox.Show( message, title );
 }

 public static bool okcancel(string title, string message) {
  DialogResult rv = MessageBox.Show( message, title, MessageBoxButtons.OKCancel );
  if( rv == DialogResult.OK ) {
   return true;
  } else {
   return false;
  }  
 }

 public static bool yesno(string title, string message) {
  DialogResult rv = MessageBox.Show( message, title, MessageBoxButtons.YesNo );
  if( rv == DialogResult.Yes ) {
   return true;
  } else {
   return false;
  }  
 }

 public static int yesnocancel(string title, string message) {
  DialogResult rv = MessageBox.Show( message, title, MessageBoxButtons.YesNoCancel );
  if( rv == DialogResult.Yes ) return 1;
  if( rv == DialogResult.No  ) return 0;
  return -1;
 }
}

댓글 없음:

댓글 쓰기