|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
9 G5 e/ Z9 K- j4 x
: l! v$ F6 L0 H N2 u3 ?- eNX二次开发源码分享:自定义yes或者no的确认对话框
7 O* N- b& V) n# L6 N4 @& F: C# _ X! ^1 d3 D$ p
static bool AskYesOrNo(string title, string message)
! V1 D4 d9 q6 K0 w {
! v: K, W. w6 I3 [: D* h" } string[] messages = { message };
7 f# ~: F! @- @4 K" O) r, K& V UFUi.MessageButtons buttons = default(UFUi.MessageButtons);0 M" u1 \; Z4 [* t4 e ~* }9 J
buttons.button1 = true;
) A k- F) _" x! Q% M3 L* x buttons.button2 = false;
( k2 G: t& s* u buttons.button3 = true;
2 d5 w/ u2 C5 ~ buttons.label1 = "Yes";
7 k" N. `1 X, g+ |" ?7 i buttons.label2 = null;" @: H Y2 x- ^' S) [4 u: P5 \
buttons.label3 = "No";! {- B" J) \+ e) z
buttons.response1 = 1;
9 z* v6 z+ M- f% F3 H0 g buttons.response2 = 0;+ |. b( f) x; F4 \8 c
buttons.response3 = 2;
1 M5 F/ `' V. Q% c5 n int resp = 0;
1 u6 u7 g/ o2 Y' a+ I; e/ f+ {, ]8 U0 A D% u2 h! v
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);* \$ n9 r+ {0 [7 R8 E' _) R
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion, & w( a+ @0 Y! W) \
messages, 1, true, ref buttons, out resp);8 C1 e9 H Z( S' W
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
, r& y0 C3 Q& S) [
) H6 Z" v. b, S# m# Q$ T) \: S if (resp == 1)) {/ m# @" q% u
return true; ?, `3 Y) _: P$ x
else0 l# S2 n' @! E9 j* n9 }3 o2 Q
return false;
0 T I4 `) j! I6 J }5 x6 U9 c; A) t! Q4 _
N9 ?6 l L. A: e1 i$ y/ u
; H: a6 G8 {! t8 Q
|
|