.NET

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

ShowModelessDialog problem

239 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 (232 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 (229 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 (221 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 (207 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 (185 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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.