Windows, forms and ALWAYS-ON-TOP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Woof-Woof

    Windows, forms and ALWAYS-ON-TOP

    I have a problem with windows in my VB projects.

    My project consists of an MDI form with many child (MDIChild = TRUE)
    and non-child (MDIChild = FALSE) forms contained within.

    The problem I have is making a form stay on top when it loses the
    focus to the main MDI form without setting it ALWAYS-ON-TOP.
    ALWAYS-ON-TOP keeps the form at the top even when I switch tasks to
    another running program (pain in the butt because then I can't see
    what I want to see). And if I don't make the form ALWAYS-ON-TOP, then
    clicking on the main MDI form makes the window I want to see all the
    time go away (when it loses focus). How do I keep my non-child windows
    still appearing "on top" even when they lose the focus? I've seen
    other programs do this and it must be a system thing because there is
    no special code in the forms that I have seen to account for this (the
    MDIChild is set to FALSE and there is no code in the activate,
    deactivate, got_focus or lost_focus events).

    Thank you.



    ---
    Allen



  • Rick Rothstein

    #2
    Re: Windows, forms and ALWAYS-ON-TOP

    From a post by Jeff Johnson:

    "You have posted this question individually to
    multiple groups. This is called Multiposting
    and it's BAD. Replies made in one group will
    not be visible in the other groups, which
    may cause multiple people to respond to your
    question with the same answer because they
    didn't know someone else had already done it.
    This is a waste of time.

    If you MUST post your message to multiple
    groups, post a single message and select all
    the groups (or type their names manually,
    separated by commas) in which you want it to
    be seen. This is called Crossposting and when
    used properly it is GOOD."

    Rick - MVP


    "Woof-Woof" <otie_nospam@co x.net> wrote in message
    news:hremc.8799 $%o1.7744@laker ead03...[color=blue]
    > I have a problem with windows in my VB projects.
    >
    > My project consists of an MDI form with many child (MDIChild = TRUE)
    > and non-child (MDIChild = FALSE) forms contained within.
    >
    > The problem I have is making a form stay on top when it loses the
    > focus to the main MDI form without setting it ALWAYS-ON-TOP.
    > ALWAYS-ON-TOP keeps the form at the top even when I switch tasks to
    > another running program (pain in the butt because then I can't see
    > what I want to see). And if I don't make the form ALWAYS-ON-TOP, then
    > clicking on the main MDI form makes the window I want to see all the
    > time go away (when it loses focus). How do I keep my non-child windows
    > still appearing "on top" even when they lose the focus? I've seen
    > other programs do this and it must be a system thing because there is
    > no special code in the forms that I have seen to account for this (the
    > MDIChild is set to FALSE and there is no code in the activate,
    > deactivate, got_focus or lost_focus events).
    >
    > Thank you.
    >
    >
    >
    > ---
    > Allen
    >
    >
    >[/color]

    Comment

    • Woof-Woof

      #3
      Re: Windows, forms and ALWAYS-ON-TOP

      I'm sorry.

      Here is the solution:

      when you show the form use the optional owner argument:

      <nonchildform>. Show vbModeless, <mdiform>


      --


      ---
      Allen

      "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message
      news:Tb-dnfdPJuxM7QfdRV n-vA@comcast.com. ..[color=blue]
      > From a post by Jeff Johnson:
      >
      > "You have posted this question individually to
      > multiple groups. This is called Multiposting
      > and it's BAD. Replies made in one group will
      > not be visible in the other groups, which
      > may cause multiple people to respond to your
      > question with the same answer because they
      > didn't know someone else had already done it.
      > This is a waste of time.
      >
      > If you MUST post your message to multiple
      > groups, post a single message and select all
      > the groups (or type their names manually,
      > separated by commas) in which you want it to
      > be seen. This is called Crossposting and when
      > used properly it is GOOD."
      >
      > Rick - MVP
      >
      >
      > "Woof-Woof" <otie_nospam@co x.net> wrote in message
      > news:hremc.8799 $%o1.7744@laker ead03...[color=green]
      > > I have a problem with windows in my VB projects.
      > >
      > > My project consists of an MDI form with many child (MDIChild =[/color][/color]
      TRUE)[color=blue][color=green]
      > > and non-child (MDIChild = FALSE) forms contained within.
      > >
      > > The problem I have is making a form stay on top when it loses the
      > > focus to the main MDI form without setting it ALWAYS-ON-TOP.
      > > ALWAYS-ON-TOP keeps the form at the top even when I switch tasks[/color][/color]
      to[color=blue][color=green]
      > > another running program (pain in the butt because then I can't see
      > > what I want to see). And if I don't make the form ALWAYS-ON-TOP,[/color][/color]
      then[color=blue][color=green]
      > > clicking on the main MDI form makes the window I want to see all[/color][/color]
      the[color=blue][color=green]
      > > time go away (when it loses focus). How do I keep my non-child[/color][/color]
      windows[color=blue][color=green]
      > > still appearing "on top" even when they lose the focus? I've seen
      > > other programs do this and it must be a system thing because there[/color][/color]
      is[color=blue][color=green]
      > > no special code in the forms that I have seen to account for this[/color][/color]
      (the[color=blue][color=green]
      > > MDIChild is set to FALSE and there is no code in the activate,
      > > deactivate, got_focus or lost_focus events).
      > >
      > > Thank you.
      > >
      > >
      > >
      > > ---
      > > Allen
      > >
      > >
      > >[/color]
      >[/color]


      Comment

      Working...