|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
9 y/ C* T5 {1 \* p4 E# E2 w! j
f1 r: J) N: i/ Z% ?' K! ]) r, V
NX二次开发源码分享:自定义yes或者no的确认对话框
/ q/ X. q0 L- n* T
0 X: z2 v0 l1 Q4 i. ]; l+ Dstatic bool AskYesOrNo(string title, string message)
5 ]% Q6 y( [. S* ^! l {
. f8 V$ u7 K9 L5 B9 i string[] messages = { message };1 w% o1 e# s& E9 c% V: D2 n
UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
* E3 v; q! q, p" \2 _ buttons.button1 = true;
) K# Z" j$ V( q; i- [) E% L; p buttons.button2 = false;
9 b( e, X* b& E( m7 n. J buttons.button3 = true;
! c) F# a1 O! f2 j buttons.label1 = "Yes";
% M& g% D0 d: ]% y1 e buttons.label2 = null;$ H0 K; @8 {! d- a3 G: |
buttons.label3 = "No";
5 ^( i' X" B/ K8 F9 a. _ buttons.response1 = 1;9 G3 t7 {9 o7 d- }
buttons.response2 = 0;0 m& S# d- q5 O7 T) r g
buttons.response3 = 2;
8 Z6 ~: z# r. P. [. E int resp = 0;
' h8 e' H5 }4 X0 `: A+ y3 e, L& k
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);
! n% D- U& X" U( ~) h theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
* ^( K* M8 _% y* s+ E- {: o messages, 1, true, ref buttons, out resp); E. M4 Y- ?# Q' a" S0 o
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);' o# _% Z" o# E- C2 `. Y( g
2 K+ Q0 x" Q l0 M$ L# n: n if (resp == 1)
1 e: u; E& R) W$ G p return true;
[+ E( @5 n, r( c. c7 { else9 i8 |2 V4 M# w% L M3 N
return false;/ x, v+ x2 J- I. K* {
}5 [7 K, E9 X( N* `
2 P$ ^1 `3 h5 J, b4 S B! M5 s
( r# b! H0 y/ a) s- f5 O/ L |
|