.NET

Reply
Active Member
nklong
Posts: 10
Registered: ‎05-10-2012
Message 1 of 6 (242 Views)

ShowModelessDialog problem

242 Views, 5 Replies
05-21-2013 12:49 AM

I showed a form with ShowModelessDialog in this way:

 

MyForm fr = new  MyForm();

Application.ShowModelessDialog(null, fr, true);

 

But when I use this.Hide() in control event, It usually jump to another window. AutoCAD is not active.

How to fix this, pls help.

Thanks.

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 2 of 6 (235 Views)

Re: ShowModelessDialog problem

05-21-2013 01:28 AM in reply to: nklong
Please try :
Application.ShowModelessDialog(null, fr, false);

Active Member
nklong
Posts: 10
Registered: ‎05-10-2012
Message 3 of 6 (232 Views)

Re: ShowModelessDialog problem

05-21-2013 01:40 AM in reply to: mzakiralam

Thank you so much. I already try your way, but still the same.

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 4 of 6 (224 Views)

Re: ShowModelessDialog problem

05-21-2013 01:57 AM in reply to: nklong
I have just tried this way and it is working for me:

testfrm f_test = new testfrm();
Application.ShowModelessDialog(f_test);

Then put the below code in a button
this.Hide()
Active Member
nklong
Posts: 10
Registered: ‎05-10-2012
Message 5 of 6 (210 Views)

Re: ShowModelessDialog problem

05-21-2013 03:04 AM in reply to: mzakiralam

I don't know why. If my form is simple, it's corect. But if have a lot of thing in form. When call this.Hide() always jump to another window.

 

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

Re: ShowModelessDialog problem

05-21-2013 10:17 AM in reply to: nklong
Then I think that you should show your code otherwise nobody can help you. May be there is something wrong with your code. Please make sure that as your are using modeless dialog, so you should lock the document before you want to do something. otherwise it will create problem.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!