Results 1 to 8 of 8

Thread: [RESOLVED] Add Control to Form Titlebar?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Resolved [RESOLVED] Add Control to Form Titlebar?

    Does anyone know how i would go about adding a control (a button) to the windows title bar area?
    Sort of like firefox does.



    I'm doing this so i can remove the Toolstrip Menubar at the top of my application to give it my "working area".

    Thanks guys.
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: Add Control to Form Titlebar?

    That comes from using custom window management/rendering code in Firefox. Basically, rather than ask Windows for a standard Windows frame like every other program, Firefox provides it's own detailed graphical instructions to the system. There's no easy way to do something like that without a LOT of heavy graphical programming.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: Add Control to Form Titlebar?

    Quote Originally Posted by Jenner View Post
    That comes from using custom window management/rendering code in Firefox. Basically, rather than ask Windows for a standard Windows frame like every other program, Firefox provides it's own detailed graphical instructions to the system. There's no easy way to do something like that without a LOT of heavy graphical programming.
    Damn it!
    Thanks mate.
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Add Control to Form Titlebar?

    What is it that you are attempting? It sounds like there might be a way around the problem. After all, you mentioned removing the toolstrip menu bar, as well as adding something to the caption. You can remove the caption without much difficulty, so if this is a matter of getting more screen area, then that would have the same result. Alternatively, you might remove the caption and add labels, buttons, and so forth to a band at the top of the captionless form that looked something like a caption, but was actually part of the form.

    So there might be other, easier, ways to get the visual effect that you desire without the painful process of writing controls to the window caption itself.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: Add Control to Form Titlebar?

    Quote Originally Posted by Shaggy Hiker View Post
    What is it that you are attempting? It sounds like there might be a way around the problem. After all, you mentioned removing the toolstrip menu bar, as well as adding something to the caption. You can remove the caption without much difficulty, so if this is a matter of getting more screen area, then that would have the same result. Alternatively, you might remove the caption and add labels, buttons, and so forth to a band at the top of the captionless form that looked something like a caption, but was actually part of the form.

    So there might be other, easier, ways to get the visual effect that you desire without the painful process of writing controls to the window caption itself.
    I'm trying to do exactly what the firefox button does.
    It's removes the need for a menu to be visible all the time, and when you click the "FireFox" button it cascades the "menu's" from that button.
    And i need the button in the title bar otherwise i don't gain those 20 extra pixels in height.

    I found a source here - http://www.codeproject.com/KB/vb/tra...lebuttons.aspx
    But it doesn't seem to work on my computer (don't think it was made for windows 7).
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  6. #6
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Add Control to Form Titlebar?


  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: Add Control to Form Titlebar?

    Ahh sweet thats what i'm after, thanks!
    Just gotta spend a bit of time trying to convert this to vb
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: [RESOLVED] Add Control to Form Titlebar?

    Well...it didn't convert to VB very well (or rather i suck at trying to convert C)
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

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