非模态对话框控制输入(Autocad VBA)
leiwww
leiwww Lv.2
2004年10月05日 19:57:32
只看楼主

原文如下:By default the modeless dialog cannot keep focus in Autocad VBA. In order toachieve that you will have register an additionall control and makereference to it under Tools > References....But let’s go step by step:

原文如下:
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....
免费打赏
taohjt
2004年11月07日 13:14:17
2楼
望而生畏~~~~~~~~~~~
回复
sdwfcjyl
2005年06月13日 22:12:18
3楼
拼音太多了
回复

相关推荐

APP内打开