|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
+ T7 e3 s# i6 T: g
" f2 D9 q1 ^' n: k5 ^
NX二次开发源码分享:自定义yes或者no的确认对话框& e1 O, L7 m k* y# {
/ B1 W! y, p9 H: |7 C f
static bool AskYesOrNo(string title, string message)
5 f. [5 J* p' k! ^ {/ z3 y2 t4 G! x" m3 y$ V. N: G/ Z
string[] messages = { message };
3 R7 F% _$ D; ?% }! U2 B6 j y UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
$ O0 _% X+ C( T' v ] B1 T0 x buttons.button1 = true;
9 A% {& e' |1 R1 q( |# K# [ buttons.button2 = false;
4 I0 w# N6 ~3 H7 S0 H7 {+ ^) D buttons.button3 = true;
9 ? v0 r; Q) b buttons.label1 = "Yes";! W/ |3 S" z: H# b! C' j4 B1 C0 }
buttons.label2 = null;1 A3 `; ?, i; j6 j; O
buttons.label3 = "No";1 S4 x* f/ V) J. o9 S( F, E
buttons.response1 = 1;
! T6 Z, `' i" _+ Q4 ]3 ^8 m/ T8 X buttons.response2 = 0;
5 X: K# m$ Z& ~ buttons.response3 = 2;
( W7 H) ~+ ]. m$ b1 s7 X+ B" r2 E# W int resp = 0;
6 L+ F. `# R% u3 e3 g1 H5 o$ e' P. I0 g( X4 {
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);" t7 z b7 _" k6 A$ I* m7 R0 a: L
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
4 B$ x7 b2 q, u messages, 1, true, ref buttons, out resp);3 I) _4 p$ Y6 D3 ~
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);6 }) y4 l# b. O- m* b
8 f" i7 L$ Z& B) r# O6 G- E$ s
if (resp == 1)
5 C- \$ N1 }# f return true;
# O1 s/ Z. {2 w0 ~ else
8 @; z# L- C: E8 C. Z6 Y# U* s x return false;
6 U" I! x- Q0 u. X }
& G3 P5 ~: S* f0 N% u5 a1 f9 u" f0 V, I8 z/ w
6 X: e8 ]* N" E# [# M
|
|