几何尺寸与公差论坛

 找回密码
 注册
查看: 857|回复: 0

【转帖】vb.net modeless dialogs in solidworks

[复制链接]
发表于 2009-4-12 22:47:22 | 显示全部楼层 |阅读模式
vb.net modeless dialogs in solidworks
hi,
problem number 1. vb.net modeless dialogs in solidworks
we are using the application.run method (as advised in sw api documentation) to display a modless form. we use the setparent api 'user32" to set the parent window for the form we want display as modeless.
here is the callback function.
public sub onsamplecallback()
dim oobj as new myapp.form1()
setparent(oobj.handle.toint32, iswapp.frame.gethwnd)
windows.forms.application.run(oobj)
end sub
attached a zip file containing the source code of myapp. not much code just a form with two buttons. compile the project ,create a sample addin, add reference of myapp and add the callback function to a button.
then load the add in and run the command.
the dialog appears in solid solidworks,
shift the focus from the form to the solidworks window
present 'enter" key.
everything hangs.
problem number 2.
to avoid this issue we stared using the 'form.show' method , in this case the 'tab and the enter key' will not work on the modeless forms.
then in some commands we show a modeless form prompting the user to select a cavity and the control moves in a
do loop waiting for the user to select a cavity. in this case also if the user press the enter key then everything hangs.
regards ,
prasenjit
hello,
i've a similar problem. i have implemented a dll in vb.net which starts a form. i use the application.run(form) method, so that i capture the tab and enter key. but if the user now switch from my form to solidworks-session (alt-tab), he can't do anything (in example. open a part, edit a part or anything else).
if i start my form with the form.show method, than it's works, but i can't capture the tab and enter key.
in visual basic 6 it works as expected. also in vb.net with solidworks 2007. but in sw 2008 i get the described problem.
is this behaviour: "works as designed" or is there a chance to support both: capture tab and enter key and let the user work in solidworks, if he switches from my form to sw?
thanks for any help!
regards, juergen
hello,
is there no chance to get help for this problem?
any help is welcome.
thanks and regards,
juergen
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 18:08 , Processed in 0.036788 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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