PLM之家PLMHome-国产软件践行者

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

[复制链接]

2015-5-31 09:19:26 3107 0

admin 发表于 2015-5-31 09:19:26 |阅读模式

admin 楼主

2015-5-31 09:19:26

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

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

x

% W9 y7 W! p1 X' h1 T" Q
! E5 i5 _3 x& F* C3 \0 E/ @! FNX二次开发源码分享:自定义yes或者no的确认对话框
8 g/ p* a$ F- s; j! r, q" g
) g0 {: V4 d/ t; astatic bool AskYesOrNo(string title, string message)
# J# y4 e9 D5 H; c2 `  t    {1 L" y# e: K! Y$ T) A
        string[] messages = { message };
. c# j6 l+ E5 a9 K: l% |! t        UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
9 \- W/ m5 F7 f9 y        buttons.button1 = true;
) n- p* ~- z$ E8 }, s  j$ r        buttons.button2 = false;& G2 B6 ~+ J* Y; m6 F/ ]
        buttons.button3 = true;+ [: g* j8 M1 T$ M0 W& ~* g
        buttons.label1 = "Yes";" F- l9 v5 `# t1 B- O% h  ~
        buttons.label2 = null;) `  p7 q. Y5 |9 @+ I3 G
        buttons.label3 = "No";1 e- ?, L8 t! T9 e1 y
        buttons.response1 = 1;9 A6 y3 X" R( O% b
        buttons.response2 = 0;/ \; ~8 q  }# r: `
        buttons.response3 = 2;
9 m: a% v8 ?5 D% O; M) E  e7 A        int resp = 0;
! T. A: G( O* T' z2 B1 W0 k$ Y" D1 x, k5 a5 v- R/ n# g: m! b1 f
        theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);9 v) |, M: A2 ?  U' d. j
        theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
2 {3 r1 d! X# c5 j: \) X            messages, 1, true, ref buttons, out resp);* j% `' N/ T& `5 S3 V( E
        theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
8 @' m* F! y  N
8 u+ i$ ?. }2 k        if (resp == 1)( ~! ~# Y& {2 ]/ Y
            return true;5 }9 H; M8 i' \+ D. O; W( h# Y
        else5 e0 |1 Z" E( I6 M. B, f* x
            return false;7 m! B% y0 x6 x  c# O
    }) T8 [$ P6 n0 E
! z* S4 D# T6 R/ g

' }( C( x  n' F4 ^7 v1 n  V. ?: _
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了