Floating Userform on CAD screen

Floating Userform on CAD screen

Anonymous
Not applicable
1,591 Views
2 Replies
Message 1 of 3

Floating Userform on CAD screen

Anonymous
Not applicable
Dear all,

I want to create a userform floating on CAD screen.
I find a example but it's in excel vba. I know nothing about API or Class Module theory

Please help me change this code to use in Cad
Thanks
Here my attached drawing embeded with code from Excel

http://www.cadviet.com/upfiles/2/modeless.dwg
0 Likes
1,592 Views
2 Replies
Replies (2)
Message 2 of 3

Norman_Yuan
Mentor
Mentor
You can forget the code from Excel example.

The VBA implemented by AutoCAD has built-in way to show UserForm as either Modal or Modeless with Modal mode as default. Simply call

UserForm.Show or UserForm.Show vbModal to get a modal form shown

Or

UserForm.Show vbModeless to get a floating form shown

However, just showing UserForm as Modeless, you may not be able to do anything useful with the floating form, because the form does not hold focus. So, in order to use modeless form in Acad VBA, you need to use the form in conjuction with acFocusCtrlxx.dll (xx is Acad version number).

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3

Anonymous
Not applicable

Hi,

Edit the property of your User form, and change the "ShowModal" option to False

0 Likes