|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
% k" `( O1 A3 D
3 u% v; `7 ]0 k$ C; I# T d: rNX二次开发源码分享:自定义yes或者no的确认对话框
4 B" e3 V6 k" L8 U1 N4 G8 ?
5 d+ i8 U& A- [% Z- Kstatic bool AskYesOrNo(string title, string message)0 i" ?5 u% t$ D% y8 U5 d+ W
{% ~- T; i! T9 c( |
string[] messages = { message };
2 r3 X/ S4 }6 o3 Y0 q+ z UFUi.MessageButtons buttons = default(UFUi.MessageButtons);! D8 D+ I5 u1 C$ w9 f
buttons.button1 = true;
# ^/ ~) Y6 M* L buttons.button2 = false;' U; f$ o3 |, K3 u- y$ s) B7 c) a
buttons.button3 = true;
+ r8 N5 }5 X; k$ A% V# [% c buttons.label1 = "Yes";4 g6 _& E* b' r6 Y! G
buttons.label2 = null;" m$ e3 x2 f4 w; K
buttons.label3 = "No";2 U+ y: M4 ?4 d
buttons.response1 = 1;
# i; L& Y& V# Y* |0 ]# ] buttons.response2 = 0; y0 P5 M; B ^- T6 u, _, p6 g3 l
buttons.response3 = 2;
8 j! e2 ~" q; ?: q5 Q, p6 Y: X8 S) B int resp = 0;+ ]; V H- G- U5 |
$ x& V7 F9 Y+ t( y& B& O theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);7 ~* t1 m D# y$ N
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
8 c+ a3 l3 i6 {6 c4 } messages, 1, true, ref buttons, out resp);
+ M9 f5 Q# }/ G" T theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
% t8 I+ G$ E. p6 R- ^
; c- S2 R' O. t8 h+ S6 { C if (resp == 1)
6 W) N9 _( ?' t7 R9 q return true;) g' |/ z" o( z0 H* P+ K/ N! n
else! L+ o. |7 U3 e) v! x' L J
return false;
7 ]; l: J/ A* @( @# v }
8 i7 L3 J* e f# e7 `4 a; N9 B. Y8 r7 L Q: x q7 e
/ n9 P. s8 J" ]7 r; N
|
|