locked
Deleted RRS feed

Answers

  • You are probably fighting a problem with the ToolStripItem classes.  They are windowless controls, note that they don't derive from the Control class.  The WF crew had to re-implement the behavior of a window from scratch and they got a it subtly wrong in a few places.  The "click to activate doesn't click" behavior is one of them.  Understandably btw, they would have to completely re-invent the window manager as well.

    I don't know of a clean workaround for this.  Having two forms active at the same time is a no-go, Windows just doesn't support it.  I can only recommend you reconsider your user interface.

    Hans Passant.
    • Proposed as answer by Kira Qian Monday, March 9, 2009 6:31 AM
    Friday, March 6, 2009 2:20 AM

All replies

  • The MouseEnter may be the best way to do it, you could set it up to check if the other form is active and if so, switch over (to prevent activation when other applications are the active form).

    I've never seen any applications which do what you want and it seems like a core windows thing to only have one active at a time, so if it's possible I see it being very complicated and probably fraught with hidden errors.
    Thursday, March 5, 2009 9:03 PM
  • What are you really trying to do? 

    Think about this for a second.  There can only be one active application or window at a time, that being the one that currently has the focus.  (Hey, there's only one cursur!)  So what are you really trying to do?

    While forms may appear to go idle when another has the focus, that is only appearances.  Forms---or any class for that matter, forms merely provide visual proof---can still react to events.  Test it for your self.  Start a form that has timer, that makes something on the form change back and forth once per second.  Now click a button on it that launches a new form.ShowDialog().  The initial form is still having fun isn't it?

    Reconsider your User Interface if you need.  There's only one cursor, so there will only be one form with the focus.  But, lack of focus does not mean lack of activity on the form!  The other forms are only as dead as your code allows them to be.

    Rudedog  =8^D
    Mark the best replies as answers. "Fooling computers since 1971."
    • Proposed as answer by Kira Qian Monday, March 9, 2009 6:31 AM
    Thursday, March 5, 2009 9:23 PM
  • You are probably fighting a problem with the ToolStripItem classes.  They are windowless controls, note that they don't derive from the Control class.  The WF crew had to re-implement the behavior of a window from scratch and they got a it subtly wrong in a few places.  The "click to activate doesn't click" behavior is one of them.  Understandably btw, they would have to completely re-invent the window manager as well.

    I don't know of a clean workaround for this.  Having two forms active at the same time is a no-go, Windows just doesn't support it.  I can only recommend you reconsider your user interface.

    Hans Passant.
    • Proposed as answer by Kira Qian Monday, March 9, 2009 6:31 AM
    Friday, March 6, 2009 2:20 AM
  • Deleted
    Tuesday, March 10, 2009 12:52 PM
  • Yes, two active forms is possible, however can formA invoke formB or/and can formA not be the main form started by Application.Run(Form1), I don't know. I am trying to implement the two environments myself. So far unsuccessfully.

    But, yes you can have two actives forms running with user switching back and forth between them. Check the following link.

    https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.applicationcontext?view=netframework-4.8

    Ayo Soul

    Friday, July 12, 2019 11:15 PM