.NET

Reply
Active Member
10 Posts
0 Kudos
Registered: ‎05-10-2012
Post 1 of 6

ShowModelessDialog problem

256 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
232 Posts
30 Kudos
Registered: ‎11-09-2012
Post 2 of 6

Re: ShowModelessDialog problem

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

Active Member
10 Posts
0 Kudos
Registered: ‎05-10-2012
Post 3 of 6

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
232 Posts
30 Kudos
Registered: ‎11-09-2012
Post 4 of 6

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
10 Posts
0 Kudos
Registered: ‎05-10-2012
Post 5 of 6

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
232 Posts
30 Kudos
Registered: ‎11-09-2012
Post 6 of 6

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 interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!