.NET

Reply
Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 1 of 9 (531 Views)

Modeless window always on top

531 Views, 8 Replies
01-17-2012 03:11 AM

Hi,

I have a problem with modeless window. It stays on top even when it loses focus.

 

This is how I show the form:

 

            Dim myForm As New myFormClass
            Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog(formOwner, myForm)

 

Any ideas? TopMost property is set to False.

Active Contributor
cincir
Posts: 32
Registered: ‎08-12-2011
Message 2 of 9 (514 Views)

Re: Modeless window always on top

01-17-2012 10:56 AM in reply to: matus.brlit

I think that is because you are using the ShowModelessDialog function and autocad threats your form as it is a paletteset. because you know palettesets are modeless windows but they are always on top. i advise you to use Form instances Hide method in forms lost focus event.

Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 3 of 9 (500 Views)

Re: Modeless window always on top

01-17-2012 10:45 PM in reply to: cincir

but that's not the behavior i want, the modeless window is the Help window and i want the user to be able to have the help shown and work with the program, be able to swithch to help and back.

the minimize works, but it's not that comfortable

Active Contributor
cincir
Posts: 32
Registered: ‎08-12-2011
Message 4 of 9 (483 Views)

Re: Modeless window always on top

01-18-2012 08:14 AM in reply to: matus.brlit

Does making help window autohide solve your problem? You can create a paletteset instead of a form and make the paletteset autohide.

 

if not try Form.Show() instead of Application.ShowModelessDialog().

Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 5 of 9 (468 Views)

Re: Modeless window always on top

01-18-2012 11:07 PM in reply to: cincir

i tried Form.Show with the same result, i guess I'm doing something fundamentally wrong, or it's AutoCAD that's causing the problem

but I'm more inclined to blame AutoCAD, because when I make a winform application, it works fine

Active Contributor
cincir
Posts: 32
Registered: ‎08-12-2011
Message 6 of 9 (456 Views)

Re: Modeless window always on top

01-19-2012 11:02 AM in reply to: matus.brlit

Which autocad are you using? I tested Form.Show in Autocad2012 and it works.

Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 7 of 9 (452 Views)

Re: Modeless window always on top

01-19-2012 11:26 PM in reply to: cincir

i'm using Civil 2012, but i run it as clean AutoCAD

 

did you use AcApp.ShowModalDialog for the main window, or did you use Form.ShowDialog ?

Active Contributor
cincir
Posts: 32
Registered: ‎08-12-2011
Message 8 of 9 (450 Views)

Re: Modeless window always on top

01-20-2012 12:09 AM in reply to: matus.brlit

I used Form.Show() not Form.ShowDialog() . i thought that you want a modeless form.

Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 9 of 9 (447 Views)

Re: Modeless window always on top

01-20-2012 12:19 AM in reply to: cincir

I am opening the modeless form from a modal form

 

form1 has a button (or responds to keypress event)  that opens form2, form1 is modal, form2 is modeless

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!