dcsimg
Results 1 to 7 of 7

Thread: Show inaktive Form in "Aktive-Style"

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    6

    Show inaktive Form in "Aktive-Style"

    When I open an new form from a form, the previous one becomes inaktiv and the titlebar appears to be kind of grayed. I would like to prevent the form doing that. I am using borderless forms to pretend some kind of "Drag & Drop", which works fine. But the flickering of the titlebar is disturbing me so I need your help. I do not want to change the apperance systemwide. I would be very pleased to get an answer.

  2. #2
    Addicted Member
    Join Date
    Aug 2017
    Posts
    165

    Re: Show inaktive Form in "Aktive-Style"

    Check this out.

    Quote Originally Posted by Victor Bravo VI View Post


    The main form appears active (red X button and drop shadow) even though the tool window actually has the focus.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    6

    Re: Show inaktive Form in "Aktive-Style"

    Thank you very much for your quick answer. Unfortunately it does not work with modal forms, even in the sample project in that originally post. Unfortunately that is what I need...

  4. #4
    Addicted Member
    Join Date
    Aug 2017
    Posts
    165

    Re: Show inaktive Form in "Aktive-Style"

    By convention, the owner window of a modal window is always shown in an inactive style. This is done to prevent confusing the user as to which window has the keyboard focus. I did try modifying that code to see what would happen if we tried to defy the convention. Sorry, but it didn't work. Windows 7 still rendered the owner form as inactive even when I sent SendMessageW(hWnd, WM_NCACTIVATE, TRUE_, 0&) from the modal form. Looks like you either will just have to conform to the convention or convert your modal borderless form to a modeless one.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    6

    Re: Show inaktive Form in "Aktive-Style"

    Thank you again for your time and effort. I need to use a modal form, because the previous method needs a kind of answer of the "PopUp"-form. I there a proper possibility to achive that kind of behavious without a form being modal ? I know that I could use a Loop but that is not very elegant to me...


    Quote Originally Posted by Victor Bravo VI View Post
    By convention, the owner window of a modal window is always shown in an inactive style. This is done to prevent confusing the user as to which window has the keyboard focus. I did try modifying that code to see what would happen if we tried to defy the convention. Sorry, but it didn't work. Windows 7 still rendered the owner form as inactive even when I sent SendMessageW(hWnd, WM_NCACTIVATE, TRUE_, 0&) from the modal form. Looks like you either will just have to conform to the convention or convert your modal borderless form to a modeless one.

  6. #6
    Addicted Member
    Join Date
    Aug 2017
    Posts
    165

    Re: Show inaktive Form in "Aktive-Style"

    Can you please explain in more detail what you're trying to accomplish? If possible, can you upload some screenshots/illustrations or even better, a small project that demonstrates what you'd like to achieve. Thank you.

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    6

    Re: Show inaktive Form in "Aktive-Style"

    A sample would be too complicated for me and I think, you brought me on the right path to solve my problem. Your trick with the not-aktiv-form was enough, even in a non-modal-form. I solved my "Modal"-Problem eventually with the "Loop" I was trying to avoid. It did the trick so I do not want annybody else to spend his time for me. Thank you again. (I am from Germany, so my english might have some mistakes)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width