|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
2 d; m7 @: _* F0 d4 _
- [. z! `3 s& D3 L kNX二次开发源码分享:自定义yes或者no的确认对话框; o1 Q* J) x! }0 m6 H3 I
( n0 Z$ c6 n7 a- ?8 W4 Ostatic bool AskYesOrNo(string title, string message)/ N+ j. e4 E2 K" _ j. N9 [
{* ?- ]6 d- |% R% `, t2 P
string[] messages = { message };
# [* v0 e f$ B4 i+ k% \ UFUi.MessageButtons buttons = default(UFUi.MessageButtons);( V) Y( l5 o4 u0 v0 P
buttons.button1 = true;
2 N) \% G6 j9 W& g6 ~ buttons.button2 = false;
/ I6 |* k& s! ~ h' J: V2 f buttons.button3 = true;
: t# X4 V/ X+ C buttons.label1 = "Yes"; Y4 Q. ?. R) P& a
buttons.label2 = null;
9 n( z: \, \1 z buttons.label3 = "No";
& { r1 }$ s% v# Y! s9 D2 t. k buttons.response1 = 1;
- W! l+ N/ ] _/ o3 o8 h buttons.response2 = 0;
: e9 {1 M' R3 n' _: F4 W buttons.response3 = 2;& U- K; Z3 w% v2 J2 X( a
int resp = 0;- ]0 W! V" |; U! r( A* R% S
) A6 K* x) B. f, }) X
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);1 u* r: a, Q; m/ M* l/ v- F
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion, ! `- U4 s/ M( _8 |" |' b& v+ O& ~
messages, 1, true, ref buttons, out resp);$ n: q1 K: q6 K1 S# P9 T- ~
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
* i! I+ j6 l, K7 s& V4 b! n8 ~% q9 f: R
if (resp == 1)
9 W" G( h1 n' a) m+ u, x return true;
& e; Z: R7 W/ |" E: [ else% p& a1 a# S6 @- H4 O$ X
return false;
8 g, T: H& Y4 i3 K }! Y" S- w5 F5 i6 K
! C6 P2 F3 S* a0 k
) g2 Z9 q" k4 X3 x |
|