.NET

.NET

Reply
Valued Contributor
hoathuongphuoc
Posts: 59
Registered: ‎11-05-2013
Message 1 of 5 (209 Views)

How to focus Autocad when click Button in form

209 Views, 4 Replies
12-03-2013 10:39 PM

Hi All,

Now, I have a problem with Form. This is. When i press button in Form(i want to draw line in Autocad), If i want to draw line in autoca, I have to click twice. I want to ask everyone. How can i only click once into cad and draw this line. I have used Application.ShowModalDialog() but my form will hide. and when my form appear so i can not click continue to cad. Thanks all. i use cad 2013.

Active Contributor
ditran
Posts: 27
Registered: ‎01-28-2013
Message 2 of 5 (202 Views)

Re: How to focus Autocad when click Button in form

12-03-2013 11:28 PM in reply to: hoathuongphuoc

You can used this method:

 

frm.Hide()

'Your code

frm.dispose()

Valued Contributor
hoathuongphuoc
Posts: 59
Registered: ‎11-05-2013
Message 3 of 5 (194 Views)

Re: How to focus Autocad when click Button in form

12-03-2013 11:51 PM in reply to: ditran

This is my question:

 

1. Before i press Button:

 

 a1.png

 

2. After i press and then draw a line

 

 a2.png

 

I use cad 2013, vb.net. Thanks everybody.

Valued Contributor
hoathuongphuoc
Posts: 59
Registered: ‎11-05-2013
Message 4 of 5 (177 Views)

Re: How to focus Autocad when click Button in form

12-04-2013 01:26 AM in reply to: hoathuongphuoc

I think its not easy.

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 5 of 5 (174 Views)

Re: How to focus Autocad when click Button in form

12-04-2013 01:42 AM in reply to: hoathuongphuoc
Hi,
first is to draw a line you need 2 Points. So it is usual that you need to click twice to select 2 Points. or do you have other idea in your mind. 2nd is regarding form. if you use the form as modal you can not perform other command as Long as form is open. In that case you can call the form as modeless Dialog. But if you want to use the form as modal Dialog and want to perform interactively with AutoCAD Editor there is a way . you have to use StartUserInteraction method which will automatically hide modal form. you can take a look on below link where this Kind of issue is discussed. may be interesting for you.

http://forums.autodesk.com/t5/NET/Problem-regarding-Modeless-form/m-p/3947116#M35369
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.