青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

青华模具培训学院
查看: 1277|回复: 3

[疑难] UG二次开发——非模态窗体

[复制链接]
发表于 2013-11-24 15:50 | 显示全部楼层 |阅读模式
使vb.net对ug进行内部二次开发。使用showdialog显示win窗体无法选中UG中对象,使用show又一闪即逝。请问什么方法可以在win窗体显示状态下与UG进行交互。
" C' x4 f; K: j' v* |% J& r7 Z
发表于 2014-2-22 20:51 | 显示全部楼层
找到办法了吗
回复 支持 反对

使用道具 举报

发表于 2014-2-28 14:51 | 显示全部楼层
采用此种方式可以使用*.show(),不会一闪而过,但是有弊端,不会在关闭窗口后自动释放。7 A# H" I" e9 r& R1 x, ^
    Public Function GetUnloadOption(ByVal dummy As String) As Integer
# `( N, |4 n8 U, p. V5 |- K% F( H3 \! s
        'Unloads the image when the NX session terminates
6 `4 m9 W+ B9 y        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
' C+ D, A2 P7 T6 ]/ X4 n: {& _( G8 ^+ S1 x
        '----Other unload options-------
: H4 L* V% I7 G        'Unloads the image immediately after execution within NX
$ g; v5 I! f. y1 W* l! P* O8 k, D6 ?        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately; ?2 Z! c/ b. h8 g" t0 W, z

/ j$ t3 s$ S4 F# c# l1 f8 _' n        'Unloads the image explicitly, via an unload dialog
# a. e/ n) q. [4 s. f        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly# {% a5 W/ z5 n
        '-------------------------------: ]+ e0 Z* j9 r! P! d+ q, A. h, x
9 a3 e' x, A7 H5 R
    End Function
回复 支持 反对

使用道具 举报

发表于 2014-3-3 14:31 | 显示全部楼层
窗体的Topmost设为true
( R' y- q* U/ n& H/ O. S! {! ?
8 t6 Q5 _3 ~" g( y$ E* q卸载项用
" a; Y7 c# Y" T" [, V* e0 dGetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|关于我们|sitemap|小黑屋|Archiver|手机版|UG网-UG技术论坛-青华数控模具培训学校 ( 粤ICP备15108561号 )

GMT+8, 2025-2-2 22:47 , Processed in 0.052510 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表