modal dialog in VB?

modal dialog in VB?

Anonymous
Not applicable
329 Views
4 Replies
Message 1 of 5

modal dialog in VB?

Anonymous
Not applicable
Is there any way to keep a form up while other actions take place with
visual basic or do I have to create an autocad dialog and call VB from that
dialog (if that is possible).

Thanks, Kathleen Liston
0 Likes
330 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
You could create an ActiveX Dll and put your VB form in it,
load it using VBA, and show it. This will cause it to be
modal rather than modeless. Putting the form in an ActiveX
DLL and loading it into AutoCAD also makes many AutoCAD
ActiveX operations run up to 10X faster than they do when
called from another process.

"Kathleen LIston" wrote in message
news:9615A57BA0117F2393CDA17F9CC40CF0@in.WebX.maYIadrTaRb...
> Is there any way to keep a form up while other actions take place with
> visual basic or do I have to create an autocad dialog and call VB from
that
> dialog (if that is possible).
>
> Thanks, Kathleen Liston
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thank you for responding. I can't find documentation to walk through this

process. I assume I have to make the DLL in Visual Basic then somehow load

in to ACAD VB, but haven't figured out how I reference it. I am able to

insert it as a reference, but not actually load (formx) that is stored in

the dll. Do I need to move all my code and functions to Visual Basic outside

of AutoCAD VB? and then compile it and load it?

-Kathleen Liston

"Tony Tanzillo" wrote in message
news:8679D9E04AFB1467AB6E8DB70478D65E@in.WebX.maYIadrTaRb...
> You could create an ActiveX Dll and put your VB form in it,
> load it using VBA, and show it. This will cause it to be
> modal rather than modeless. Putting the form in an ActiveX
> DLL and loading it into AutoCAD also makes many AutoCAD
> ActiveX operations run up to 10X faster than they do when
> called from another process.
>
> "Kathleen LIston" wrote in message
> news:9615A57BA0117F2393CDA17F9CC40CF0@in.WebX.maYIadrTaRb...
> > Is there any way to keep a form up while other actions take place with
> > visual basic or do I have to create an autocad dialog and call VB from
> that
> > dialog (if that is possible).
> >
> > Thanks, Kathleen Liston
> >
> >
>
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Your form must be wrapped in an ActiveX class in the VB
ActiveX DLL.

This allows you to create an instance of it in VBA, which
will be loaded into AutoCAD's process.

You would add a method on your class that can be called
when you load it into VBA, and that method can show your
form.


"Kathleen LIston" wrote in message
news:11955579F54329C579D6A17E426CD125@in.WebX.maYIadrTaRb...
> Thank you for responding. I can't find documentation to walk through this
>
> process. I assume I have to make the DLL in Visual Basic then somehow load
>
> in to ACAD VB, but haven't figured out how I reference it. I am able to
>
> insert it as a reference, but not actually load (formx) that is stored in
>
> the dll. Do I need to move all my code and functions to Visual Basic
outside
>
> of AutoCAD VB? and then compile it and load it?
>
> -Kathleen Liston
>
> "Tony Tanzillo" wrote in message
> news:8679D9E04AFB1467AB6E8DB70478D65E@in.WebX.maYIadrTaRb...
> > You could create an ActiveX Dll and put your VB form in it,
> > load it using VBA, and show it. This will cause it to be
> > modal rather than modeless. Putting the form in an ActiveX
> > DLL and loading it into AutoCAD also makes many AutoCAD
> > ActiveX operations run up to 10X faster than they do when
> > called from another process.
> >
> > "Kathleen LIston" wrote in message
> > news:9615A57BA0117F2393CDA17F9CC40CF0@in.WebX.maYIadrTaRb...
> > > Is there any way to keep a form up while other actions take place with
> > > visual basic or do I have to create an autocad dialog and call VB from
> > that
> > > dialog (if that is possible).
> > >
> > > Thanks, Kathleen Liston
> > >
> > >
> >
> >
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
Make your dialog modeless (vbmodeless) add a reference to AutoCAD Focus
Control for VBA Type Library. Then add that control to your toolbox
(AcFocusCtrl Class) and drop it onto your form.

When you click your command button to do something, set the property
keepfocus = false see below:

Me.AcFocusCtrl1.KeepFocus = False

When you want to return focus to your form (such as mouseover) use the
following

Me.AcFocusCtrl1.SetFocus

To interact with your form you must set the KeepFocus property to true such
as:

Me.AcFocusCtrl1.KeepFocus = True

Works like a charm for me!

RBinning


"Kathleen LIston" wrote in message
news:9615A57BA0117F2393CDA17F9CC40CF0@in.WebX.maYIadrTaRb...
> Is there any way to keep a form up while other actions take place with
> visual basic or do I have to create an autocad dialog and call VB from
that
> dialog (if that is possible).
>
> Thanks, Kathleen Liston
>
>
0 Likes