|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
; V w; C# M- P8 D4 k' I
* `% r `% I% s0 UNX二次开发源码分享:自定义yes或者no的确认对话框1 i# o* k+ @% R" G( \. O& M# x/ t
* [& ^* \. T- i4 k4 T' d) B
static bool AskYesOrNo(string title, string message) n9 p: s6 b5 j& y g
{. X; G$ d# h- ~; @ w! q
string[] messages = { message };7 }$ ?% _5 q/ f* A# O. W" C7 p
UFUi.MessageButtons buttons = default(UFUi.MessageButtons);. G2 c( J0 N) u4 |* o4 ], D# W
buttons.button1 = true;, H' L k1 ^4 D, u1 l- V
buttons.button2 = false;2 {& Y+ b8 n7 i. }% J
buttons.button3 = true;, r4 M4 ]1 |( G* A! ]5 r
buttons.label1 = "Yes";
' f+ T+ I% m+ C& d buttons.label2 = null;
+ N. ^) q1 |. D buttons.label3 = "No";/ K! B" v4 J! g. G) }
buttons.response1 = 1;
/ T; k1 \0 ?. c! N% H4 P buttons.response2 = 0;; q. I5 d6 i% D) V, P6 S0 ~: u; O
buttons.response3 = 2;2 h' @+ c" y" I! R
int resp = 0;/ q9 a8 k6 V- X5 F
. ~9 x/ l! a; U* b1 ? theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);
" ]& G( ^# S9 h( X+ ^, a theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion, - a& e; B- O- W n
messages, 1, true, ref buttons, out resp);
2 J& C$ Y$ [/ J8 C+ X0 A6 u; g theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);+ G/ \# @0 g W2 {/ Q: {; y
3 ~& {/ S. w9 i0 R. Z, D8 f
if (resp == 1)
1 L n" j' R) S7 X4 K7 Z return true;
8 e3 k1 B* _$ i4 { else
! Z3 F8 @% }6 z5 i5 z% @ return false;
4 N& Z: ?( ]% z' y" i; Q# X( q! @ }7 n/ h' L: \% a" x
* p2 W, H, ^' j# E* G% P) x/ ~" F. C
|
|