|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
& H% w4 t# v" l8 S" o5 A6 B( K8 I* q5 o3 O9 t
NX二次开发源码分享:自定义yes或者no的确认对话框( M/ Q3 ~) W0 d! p0 k* Q: _* f" K
' i5 d: e( g; Xstatic bool AskYesOrNo(string title, string message)
& [- ~' H0 D4 Z" G: c5 s# R1 O! i {
. d, S' ?! g1 T: }4 E* D; ~ string[] messages = { message };! e W9 R2 H/ H2 k) ~& o
UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
( j( `* e- b( O4 A# w& I' u buttons.button1 = true;$ ]* U+ ^' Q( i' P
buttons.button2 = false;- D. a% P, o! z1 W6 U
buttons.button3 = true;; _! \0 s) r3 s: p
buttons.label1 = "Yes";0 G- ^, u8 K% u! ]3 c% ^; V5 I
buttons.label2 = null;
; P8 Q7 Y1 n- T, ?$ N# k! x buttons.label3 = "No";
. X/ U/ c m! P3 g. k buttons.response1 = 1;
; i5 I% J1 m3 Y, f" @3 V% ~( w: S buttons.response2 = 0;
1 X1 I' }& q2 t8 O buttons.response3 = 2;
/ G8 y( t& m. ]1 ~1 i int resp = 0;
9 e) o% E/ s k* `. z( y4 t
! c! ^2 ]& H+ W% s& S theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);; D& W' ?; N. ]1 U, K% j
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
8 z# m+ Q) `5 y2 @# K5 a. N messages, 1, true, ref buttons, out resp);2 z4 A1 P$ {) Y4 ]: \: |
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
5 a ~2 l7 I$ j- a/ e$ |2 N6 C9 |1 ^6 Y* S) m
if (resp == 1)4 h& m* H+ h* Z. t+ f1 g
return true;
I4 V8 x3 Z7 @5 s* X else
3 v. h- o* }. c return false;
4 {3 m& U# w$ `/ r6 b }
8 {0 l4 c3 [8 [; ]. B/ S6 A# f: _! v& v
4 q. i5 Z0 @/ e" V7 O4 Y& w |
|