NX二次开发源码分享:自定义yes或者no的确认对话框
NX二次开发源码分享:自定义yes或者no的确认对话框
static bool AskYesOrNo(string title, string message)
{
string[] messages = { message };
UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
buttons.button1 = true;
buttons.button2 = false;
buttons.button3 = true;
buttons.label1 = "Yes";
buttons.label2 = null;
buttons.label3 = "No";
buttons.response1 = 1;
buttons.response2 = 0;
buttons.response3 = 2;
int resp = 0;
theUFSession.Ui.LockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
messages, 1, true, ref buttons, out resp);
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
if (resp == 1)
return true;
else
return false;
}
页:
[1]