|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
; X0 A+ k i3 q
5 K, E4 Z. a' _2 l6 x& GNX二次开发源码分享:自定义yes或者no的确认对话框
5 T3 h0 I' _5 D" u; P5 Z( ^: _. p) O- z/ c/ L
static bool AskYesOrNo(string title, string message), y! N" x: A9 s o) P0 X3 }( Z
{
' w8 ^# ?$ v& }: t string[] messages = { message };
" L7 i% C5 }" i f4 @* m UFUi.MessageButtons buttons = default(UFUi.MessageButtons);2 _: E9 X0 x5 i9 |" m
buttons.button1 = true;, P* u& _ q, o# X" t7 P2 l
buttons.button2 = false; H% Z( O! V/ c! h+ k( p
buttons.button3 = true;! j" m& W7 S; R6 O1 Q' l
buttons.label1 = "Yes";; y7 N8 n" k# V% g) i
buttons.label2 = null;# M- m Y7 r3 ~$ W0 U3 |/ J
buttons.label3 = "No";. Q2 c+ Q3 A$ v) d- [/ B
buttons.response1 = 1;9 L3 H/ q2 C8 `3 I I7 i
buttons.response2 = 0;
( d( t" X9 y* L$ t& N buttons.response3 = 2;
# m+ }: H0 M5 {2 w1 m& K3 ] int resp = 0;$ t5 q5 o( v; I8 h' w
6 _' I Q5 G/ M/ [ theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);
% D- l8 T" `& h, @1 w0 J. Q3 X theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
8 x+ H: |9 z: e6 Q! j messages, 1, true, ref buttons, out resp);
7 U( f: k8 c) e+ A2 S theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);: L. r, e9 p, Q; s- U
. d8 D+ `, P, K
if (resp == 1)
; x7 Z. j q! I& E return true;
2 V2 B' V: c/ U/ v B" ?6 t3 Q else( C- i6 E4 X7 h% @
return false; u/ [6 I; F# G: M: J! H' B6 E- C8 w
}4 O, ^/ S3 y* p# M3 S/ b
- C% d& }$ y$ F5 K I# `
$ [2 S. R$ }% d, O4 w |
|