|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
% W9 y7 W! p1 X' h1 T" Q
! E5 i5 _3 x& F* C3 \0 E/ @! FNX二次开发源码分享:自定义yes或者no的确认对话框
8 g/ p* a$ F- s; j! r, q" g
) g0 {: V4 d/ t; astatic bool AskYesOrNo(string title, string message)
# J# y4 e9 D5 H; c2 ` t {1 L" y# e: K! Y$ T) A
string[] messages = { message };
. c# j6 l+ E5 a9 K: l% |! t UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
9 \- W/ m5 F7 f9 y buttons.button1 = true;
) n- p* ~- z$ E8 }, s j$ r buttons.button2 = false;& G2 B6 ~+ J* Y; m6 F/ ]
buttons.button3 = true;+ [: g* j8 M1 T$ M0 W& ~* g
buttons.label1 = "Yes";" F- l9 v5 `# t1 B- O% h ~
buttons.label2 = null;) ` p7 q. Y5 |9 @+ I3 G
buttons.label3 = "No";1 e- ?, L8 t! T9 e1 y
buttons.response1 = 1;9 A6 y3 X" R( O% b
buttons.response2 = 0;/ \; ~8 q }# r: `
buttons.response3 = 2;
9 m: a% v8 ?5 D% O; M) E e7 A int resp = 0;
! T. A: G( O* T' z2 B1 W0 k$ Y" D1 x, k5 a5 v- R/ n# g: m! b1 f
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);9 v) |, M: A2 ? U' d. j
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
2 {3 r1 d! X# c5 j: \) X messages, 1, true, ref buttons, out resp);* j% `' N/ T& `5 S3 V( E
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
8 @' m* F! y N
8 u+ i$ ?. }2 k if (resp == 1)( ~! ~# Y& {2 ]/ Y
return true;5 }9 H; M8 i' \+ D. O; W( h# Y
else5 e0 |1 Z" E( I6 M. B, f* x
return false;7 m! B% y0 x6 x c# O
}) T8 [$ P6 n0 E
! z* S4 D# T6 R/ g
' }( C( x n' F4 ^7 v1 n V. ?: _ |
|