Jump to content

user form focus


PeterPan9720

Recommended Posts

Pls somebody could help me in this issue ?

I created a userform for a Macro, the form contains also a command button, but every time I click on it, on mouse keyup the focus pass to the below window (dwg) with the form of course already visible.

 

Thank you

Link to comment
Share on other sites

I actually dont even have my acad on this pc, but from memory, i remember this problem .... you probably have a NON-Modal form running on top of your acad window, (to allow selections from the drawing window).. i believe you also need to drop on the acFocus control (an invisible control supplied by autocad). Select "additional Controls" from your VBA tool palette, and add this control to your VBA tool palette. Drag and drop it onto your form.

Link to comment
Share on other sites

Thank you for your reply, Yes you are right, searching more on internet I found the acFocus control add-on, now it'ìs working fine.

 

Thank you

Link to comment
Share on other sites

  • 9 months later...

Hi guys... Old thread, I know, but I'm having this problem too..

 

I've just created a fairly simple userform for a VBA macro, but ever time I click on the form (or one of the controls) the focus toggles from the form to AutoCAD or vice versa. I understand this is a common problem, and I've found atleast one solution in this thread: http://forums.autodesk.com/t5/Visual-Basic-Customization/Modeless-forms/m-p/343467/highlight/true#M35355

 

However, I tried adding the AcFocus control, but I get a warning saying "Class not registered" when I try adding the control to my form. When I added reference to the .dll file, I found a slightly differently named file in a different location, but I suspect this is because I'm on a x64 system. The file I found was: C:\Program Files (x86)\Common Files\Autodesk Shared\AcFocusCtrl16.dll

 

Does anyone have any experience with this problem and how to solve it?

 

Thanks in advance.

Edited by Hickoz_bro
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...