Creating Menus in VBA

Creating Menus in VBA

Anonymous
Not applicable
2,749 Views
8 Replies
Message 1 of 9

Creating Menus in VBA

Anonymous
Not applicable
I am Developing User Interface in VBA for AutoCAD but I am not able to
create Menus as we do it in Visual Basic by going into Tools--> Menu Editor,
there is no such Menu Editor in VBA. can anybody please advice.

Thanks
Sanjay
0 Likes
2,750 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Correct. No menu's available in VBA.

Regards - Nathan
0 Likes
Message 3 of 9

Anonymous
Not applicable
Uhmm, that's a little misleading. There is no VB-style (visual) menu editor
available in AutoCAD's VBA. You can, however, work with the AutoCAD main
menu bar, sub-menus, and tool bars jsut fine. Take a look in the help file
here:
Developers Help
ActiveX and VBA Developer's Guide
Customizing Toolbars and Menus
--
John Goodfellow
irtfnm
use john at goodfellowassoc dot com




wrote in message news:5110950@discussion.autodesk.com...
Correct. No menu's available in VBA.

Regards - Nathan
0 Likes
Message 4 of 9

Anonymous
Not applicable
Not misleading at all. Modifying AutoCAD's menus is not the same as being able to add menus to your own form.

Regards - Nathan
0 Likes
Message 5 of 9

Anonymous
Not applicable
Sanjay Jamalpur wrote in
news:5110151@discussion.autodesk.com:

> I am Developing User Interface in VBA for AutoCAD but I am not able to
> create Menus as we do it in Visual Basic by going into Tools--> Menu
> Editor, there is no such Menu Editor in VBA. can anybody please
> advice.
>
> Thanks
> Sanjay

You CAN add menus to VBA userforms by using the Windows API, see attached
JPG. It only works on modal forms although from reading other posts I think
you can not use modeless forms at all in Autocad.

Attached is a VBA sample project.


- Jose
0 Likes
Message 6 of 9

Anonymous
Not applicable
hmmmm, maybe that is why focus will not on my modeless form?

I've every which way to keep focus on my form with no luck. I want to be able to input into a text box.

Any ideas?
0 Likes
Message 7 of 9

RonnieWilkins
Advocate
Advocate
You will need to place the AcFocusCtrl onto your modelss userform in order for it to retain input focus.

In VBA, right-click on toolbox and choose Additional Controls...
Next 'x' the AcFocusCtrl control.
Finally drag the new control onto your modless dialog, it doesn't matter where at as it will be invisible at runtime.
Ronnie Wilkins, Jr.
0 Likes
Message 8 of 9

Anonymous
Not applicable
Thanks for that.

But it wasn't invisible at runtime, and I had to click on it in the form before it would stay focused.

Using ADT 2006
0 Likes
Message 9 of 9

Anonymous
Not applicable
Well, after toggling in visible property of the control, it works as you have decribed now
0 Likes