|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
9 n6 n. y2 a! T$ l. `' `9 I. ?% Q/ @; ]% J
NX二次开发源码分享:自定义yes或者no的确认对话框
+ e; w. O, T7 \; l( n4 a B' J4 W7 g' d( R
static bool AskYesOrNo(string title, string message)
- x6 B5 @+ j V1 }9 P {- h; ?% o1 \( w# X
string[] messages = { message };
N8 z% J- Y3 G3 z3 D& k UFUi.MessageButtons buttons = default(UFUi.MessageButtons);) f1 {0 k/ Z, _
buttons.button1 = true;
4 P ^+ [" L5 }: N$ F buttons.button2 = false;
4 \2 C- p3 I; m! w# x buttons.button3 = true;
: W% N7 }* s* I% r9 F buttons.label1 = "Yes";
" l" ?1 Q, b$ ?8 i, S3 ~3 l buttons.label2 = null;* x, m" c# h; ]* y
buttons.label3 = "No";
! C6 e) b. g S buttons.response1 = 1;
: p. b% T& J( |& G% r buttons.response2 = 0;
* m8 S" `9 ?& l7 u; G' q buttons.response3 = 2;: D, R( u- N/ n7 \- ^+ D" u
int resp = 0;
% i0 c9 b0 v) Y- |! Y. K4 ~* m
( O) j, o$ L- d( o- E, D- f3 D theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);* a8 H5 L; z2 b: }( Z
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
! _8 v2 h1 W% Q5 p9 x messages, 1, true, ref buttons, out resp);! J$ ?% n. Y' j( K/ k9 w3 w
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);" {* F3 n( k9 ?% S" Y
8 a, {7 |. n9 r& L U: I7 P* [ if (resp == 1)2 l" p7 x& x+ X2 N0 ]; s0 Y% X
return true;+ N [/ ]. l& w) j( |3 s/ U
else
" y' K: C* k' G/ r7 G) } return false;
# s. [! l$ V* y7 m, ?4 L* d }
) ]8 }" g0 w" g* v/ [
/ H$ J8 o- i6 Q3 I& h
/ W+ V8 X' f0 m Q! P |
|