|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
$ K- {+ V. E8 Q5 Q* C
" D% P7 s- S+ K( L* g, j
NX二次开发源码分享:自定义yes或者no的确认对话框4 Z3 r9 o5 e S" O% P
( G1 Q0 I; @7 L
static bool AskYesOrNo(string title, string message)
: \8 b% S" B% M; h4 Y {
1 u* S7 n$ P* M. ?3 K9 ^. o+ ^" \9 X2 t string[] messages = { message };
3 X1 r9 m" B: z( O } UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
$ w. ~7 ~# n P3 g/ ~( o3 Q3 X buttons.button1 = true;
5 }6 ^' Q5 N& e( ~ buttons.button2 = false;; P% ?8 K& _, H2 C, K4 E2 T
buttons.button3 = true;
% ^3 z$ i& N( p0 {, R0 ^ buttons.label1 = "Yes";
5 T5 R5 a* w) D& P, M0 Z! ?( P buttons.label2 = null;+ ^1 \6 L! l0 w/ o$ m
buttons.label3 = "No";
7 G. j4 S- u7 P2 O6 u+ _8 d1 b* U buttons.response1 = 1;
; X% _" ~ x9 a buttons.response2 = 0;
" V- @8 R" C* o' {; R D buttons.response3 = 2;: c3 B6 }: i7 Q+ q. k
int resp = 0;) H T b. r: |
2 Y/ A5 M# b$ G! M; ^
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);8 M, g; }6 P. C6 c2 f
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
' h+ W! d( C0 R7 W7 L0 ^; ?- d; M7 i messages, 1, true, ref buttons, out resp);+ t% y1 W' Y4 \( \4 W
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);. @( y" w$ b/ G3 e0 I- y0 ?$ n& t
2 L( P# X. P4 E! Q/ }
if (resp == 1)
; d: P2 T' x2 J6 {4 b" r return true;+ k2 E7 b/ p3 w5 T
else/ Z( ]2 t2 w7 {3 v0 M
return false;
, V/ [' P6 u* M6 `+ l3 Q }# [7 a3 ?; y8 B% ]3 D) r7 d% n
( N' m0 Q5 X7 V. c0 D+ }: A
0 M8 G0 e) h3 O& J1 U |
|