public static void ShowError(string MessageText)
{
MessageBox.Show(MessageText, "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
跳出提示訊息方塊
public static void ShowHint(string MessageText)
{
MessageBox.Show(MessageText, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
跳出警告訊息方塊
public static void ShowWarning(string MessageText)
{
MessageBox.Show(MessageText, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
跳出疑問訊息方塊
public static bool ShowQuestion(string MessageText)
{
return MessageBox.Show(MessageText, "問題", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2).Equals(DialogResult.Yes);
}
跳出疑問訊息方塊(YesNoCancel)
public static DialogResult ShowConfirm(string MessageText)
{
return MessageBox.Show(MessageText, "問題", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button3);
}
沒有留言:
張貼留言