|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- h7 u& j, H1 X+ x
9 L9 k/ D! U8 O1 _NX二次开发源码分享:自定义yes或者no的确认对话框
" s5 ]7 M! Z l) w( i$ h% K0 V" ~6 e; r" I, b/ S2 J& X- s4 p
static bool AskYesOrNo(string title, string message)* ~5 ^& h$ E& e# n/ d, m1 j
{
4 D, b2 T. }+ [# [1 U8 w string[] messages = { message };
% ^$ L) X6 S2 B: f1 J UFUi.MessageButtons buttons = default(UFUi.MessageButtons);3 Y0 a, q: T- G a* T: V
buttons.button1 = true;) |0 a+ S/ k4 l' g. x, {
buttons.button2 = false;
' _% h' @7 O1 s* H2 |' Q I( G buttons.button3 = true;# D6 w2 _& M% b, c* k
buttons.label1 = "Yes";
' O" C" u* r6 R! p# {+ j buttons.label2 = null;
% u% E& W7 p- G" a+ K' U buttons.label3 = "No";
( z7 [4 F. W/ t5 |& C2 W buttons.response1 = 1;5 q$ @% b/ \ t+ C
buttons.response2 = 0;1 i7 _6 K4 x( b* _2 [( [
buttons.response3 = 2;% z' X2 [! @1 v( e7 Q
int resp = 0;
. S* d9 \( L2 q" w% T# W# A3 D, |5 S8 A2 A0 F) g3 Z
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);1 u0 }; K2 G, ~9 h% p2 h- ]
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
- w0 t7 e- V {8 D% V/ k messages, 1, true, ref buttons, out resp);* ]/ e- `2 e9 \
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);8 i: t# Q6 m/ I2 g6 |
% e& P2 ~9 V. A; A/ y
if (resp == 1): y* a) o+ Y4 }& A. ]# N* G# S
return true;" w( A5 Q! k: e9 J" V# j9 H
else
, n! C8 B! W: f- \$ d' u& U6 E return false;) j1 Q5 P7 I3 r3 q3 {3 K, Z" B
}1 s. C7 j6 ~; y, A! ^
1 w0 Q( k! ?( T4 `
+ \7 v$ O9 |6 x |
|