查看: 3333|回复: 0

[资料分享] NX二次开发源码分享:自定义yes或者no的确认对话框

[复制链接]

4

主题

3

回帖

44

积分

管理员

积分
44
发表于 2015-5-31 09:19:26 | 显示全部楼层 |阅读模式

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

×

) o% @7 W. |  i; c6 f, D' w/ e
  i0 l# q, Q6 T; h4 c+ N; wNX二次开发源码分享:自定义yes或者no的确认对话框
2 D0 F5 H; }2 V7 [' z. A( x- b" f, S  V" D* a
static bool AskYesOrNo(string title, string message)  `2 b  |$ T! _% P! Z  P
    {- v2 O; s" L; o' U
        string[] messages = { message };* o- M' P+ @8 r  D% ]
        UFUi.MessageButtons buttons = default(UFUi.MessageButtons);) |/ Z! _/ V: }
        buttons.button1 = true;
( b' d8 m+ H( p. r7 D5 g6 L        buttons.button2 = false;% X4 e; t2 A/ D4 p5 ~3 _
        buttons.button3 = true;
+ B: U0 [$ L: m9 _        buttons.label1 = "Yes";/ t0 Q8 o( g, Q8 g3 U) r
        buttons.label2 = null;2 P2 c' \) a" H& u9 X- a
        buttons.label3 = "No";
% M9 Y3 Q' U4 R! n9 L; J        buttons.response1 = 1;; L# |& F2 i. ]- m6 O  E/ [# U# ~
        buttons.response2 = 0;
* f: t6 b/ {. c' Z( l8 V9 }        buttons.response3 = 2;2 `# {5 L. R% t) I3 F! }
        int resp = 0;
3 t* T) y3 J! W" K/ \
3 X# u6 @: [; ~- @4 z" f        theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);
( m1 u! K# y- A" T' ]! O0 T7 z        theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion, ' Q/ l* \+ k2 G& ~- L
            messages, 1, true, ref buttons, out resp);, V4 C+ z0 Z  j
        theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);: G* i: X$ J; b3 G! B; K$ ^1 b

- ~1 m2 v0 [0 [# w0 |7 A        if (resp == 1)
) z" O, w+ c0 s( \            return true;
5 J  }3 m7 r2 \! Q& A. r        else
8 G1 g# c, o4 n7 J$ @6 X7 S            return false;
" t' w; t* K) a# i2 Z8 P1 [5 }- j    }0 V" v7 P' N3 Y

( A+ d7 W5 V" U6 H! z7 t5 F" d- f* ]( M) T, f5 A  `: C
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部