土木在线论坛 \ 建筑设计 \ CAD下载及教程 \ 非模态对话框控制输入(Autocad VBA)

非模态对话框控制输入(Autocad VBA)

发布于:2004-10-05 19:57:05 来自:建筑设计/CAD下载及教程 [复制转发]
原文如下:
By default the modeless dialog cannot keep focus in Autocad VBA. In order to
achieve that you will have register an additionall control and make
reference to it under Tools > References....But let’s go step by step:
1. First you’ll have to register a AcFocusCtrl.dll under Windows. You can do
that by going to the Start menu and selecting Run. In the window that pops
up write the following line (this is how the path looks on my computer, on
yours could be a bit different)
regsvr32 "C:\Program Files\Common Files\Autodesk
Shared\AcFocusCtrl.dll"
2. After that, go to the Acad VBA go to the Tools > References... and check
the box for the AcFocusCtrl 1.0 Type Library.
3. Now you can use your new control by putting it on your modeless dialog
form. Don’t wory where will you put it, it doesn’t show up once you run your
program.
4. Add a following Sub in the code window for your modeless dialog.
Private Sub UserForm_Initialize()
Me.AcFocusCtrl1.KeepFocus = True
End Sub
5. Thats it . . .
6. . . . if you are using Acad 2002 which comes with VB6, but if you are
using Acad 2000i which comes with VB5 ( I think) you don’t have the before
mentioned dll on you computer. Now here we are walking in a bit grayish
area, but the easiest way is to find a nearest computer with an Acad 2002,
grab the AcFocusCtrl.dll file, put it under C:\Program Files\Common
Files\Autodesk Shared and follow the instructions under 1.,2.,3....

全部回复(2 )

只看楼主 我来说两句抢地板
  • sdwfcjyl
    sdwfcjyl 沙发
    拼音太多了
    2005-06-13 22:12:13

    回复 举报
    赞同0
  • taohjt
    taohjt 板凳
    望而生畏~~~~~~~~~~~
    2004-11-07 13:14:07

    回复 举报
    赞同0
这个家伙什么也没有留下。。。

CAD下载及教程

返回版块

52.08 万条内容 · 666 人订阅

猜你喜欢

阅读下一篇

win2000下如何方便地切换屏幕分辨率?

原来用98,现在改用2000,很多不习惯的地方主要一个是屏幕分辨率不好切换,98下可以通过设置,在系统托盘出现一个快捷按钮,在那里就可以直接选择各种需要的不同分辨率,2000下无论如何也找不到类似的方法了。另外,98下不同分辨率只要使用过就可以自动记下该分辨率设定的屏幕刷新率,而2000好象不行,每次改变分辨率之后刷新率都会改成默认的60HZ,真是受不了……由于在画图和其它应用时喜欢采用不同的分辨率,这给我带来很大不便,望2000高手帮忙解答一下,谢谢啦

回帖成功

经验值 +10