Results 1 to 11 of 11

Thread: Floating A Form (But Not Always On Top) - [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Resolved Floating A Form (But Not Always On Top) - [RESOLVED]

    in VB6 I use to do this to hover a form over the underneath form.. kinda like a toolbox.

    Form2.Show, form1

    Form2 is the toolbox
    Form1 is the Main form

    How do I do this in .NET

    I know how to show a form

    Dim f as Form
    f.Show() .....or.... f.ShowDialog

    But I want to float a form, yet not be "always on top" of all windows on desktop.

    Thanks
    Last edited by epixelman; Mar 28th, 2005 at 01:05 PM.

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Hovering A Form

    MyForm.Topmost = true

    Can't remember if that makes it stay above ALL apps or just be at the top if all the windows within your program. Could be all come to think of it.
    I don't live here any more.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Hovering A Form

    Yes... using TopMost allows it to stay above all windows (even not my app)

    But I don't want that

    In VB6 when you used the "Form2.Show, form1" you could use Form1 (main form) while form2 (toolbox) stayed above the main form.

    When you minimize the main form, the toolbox (form2) would minimize with it.
    Last edited by epixelman; Mar 27th, 2005 at 07:29 AM.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Hovering A Form

    Well... I still am looking for a solution for a "hovering" toolbox form.

    I can get it minimize now when I minimize the Main Form....

    But now the problem is.... If I click on another app (not mine) then the toolbox window (which TopMost is True) stays above all windows.

    I want it to be a child (i think??) of the main form and disappear behind the app that I selected... say WordPad or something.

    Why does this seem so hard. In VB6 it is just as easy as this...

    Form2.Show, Form1

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Hovering A Form

    Any ideas??

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Hovering A Form (Not Always On Top)

    I have poured over (6 hours) the SDK docs to find a solution. The SDK Doc says to use "fForm.Show()" to show a modeless form.

    And it does what it is suppose to.

    But I still can not figure out how to just make the toolbox form (form2) stay above Main form (Form1) but yet not be TopMost above all others.

    When I use TopMost on the Toolbox, it stays above ALL windows that I have open. I don't want that.

    This is suppose to be a floating toolbox that only stays above the main (or parent) form, but will stay with the main form if I click on, say a Notepad window.

    Does anybody know what I am trying to do??
    .
    Attached Images Attached Images  

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Angry Re: Floating (hovering) A Form (Not Always On Top)

    How do people float a "Find-Replace Text", "Spell Check" or "Toolbox" form in their apps.

    Surely M$ didn't do away with this method too!!??

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Floating (hovering) A Form (Not Always On Top)

    Come on here...

    Are there any .NET programmers here?


  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Floating (hovering) A Form (Not Always On Top)

    I thought this was a forum where you can find answers??


  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Floating (hovering) A Form (Not Always On Top)

    bump

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: Floating A Form (But Not Always On Top) - [RESOLVED]

    RESOLVED!!

    I can't believe noone knew this.



    VB Code:
    1. f = New Form1()
    2. f.TopMost = False
    3. f.Owner = Me
    4. f.Show()
    FYI... You will not need any special resizing code to minimize toolbox (floating form) as I mentioned at the start of the thread.
    .

Posting Permissions

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



Click Here to Expand Forum to Full Width