|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
! a6 \6 V4 p# `7 b* a% ]' s V$ S! w
6 r! p0 N0 H( Y! Q
NX二次开发源码分享:自定义yes或者no的确认对话框
# k" T8 c8 d! {4 s+ R8 D1 H$ d: `. M2 X
static bool AskYesOrNo(string title, string message)
6 h" H- b6 s8 O0 ~* p {% K$ L5 G3 w( m! W1 M
string[] messages = { message };8 u# }+ k2 z: R. o$ v
UFUi.MessageButtons buttons = default(UFUi.MessageButtons);, j$ [) k: A+ N' Q; a
buttons.button1 = true;
% u/ P5 M/ l3 ~8 b0 f buttons.button2 = false;
* }! E p; ^( \; V" r" b1 H buttons.button3 = true;: G6 A* `/ D3 D3 [
buttons.label1 = "Yes";$ Q3 \! V/ M( V6 j& r0 L5 M; o n, E
buttons.label2 = null;+ B A' c# G) [$ D
buttons.label3 = "No";
+ S3 S, `; u2 j4 ^. d9 p! J6 P" s buttons.response1 = 1;
) o* B k9 W3 e. P% O buttons.response2 = 0;
% z/ @+ @9 R3 S6 m% h$ T& p* n, c buttons.response3 = 2;5 _) [) W& _6 |* n. c# Y
int resp = 0;
$ l2 s! f3 o& j" {- t4 ^ c9 H% {1 {( e7 x* Q. T1 w# L
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);
( E; @2 C) o& Z) R, X; a5 {, I% _* m theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
! d) S' a; ]6 r% \( C* y# `6 a messages, 1, true, ref buttons, out resp);6 a+ H+ ]$ z0 A2 b. L$ L
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);. z5 b- Y+ k7 d( B \8 l- {
' h4 T* o4 P6 H. e if (resp == 1)
% K4 F5 ~4 Y( }" o$ d return true;/ f: X, [! `# j7 [) s
else2 T& K! M2 J9 x! |6 Q( E- _- ~
return false;" k. p4 Z! G$ i5 o7 b8 B8 T
}( s( x" n- U4 Y. E
q5 @% ] y7 X( N; k* K/ c$ ~: z
2 X9 d" `% F! k8 O7 a8 |; ^' e! {) z/ ~ |
|