Results 1 to 6 of 6

Thread: How can I put a TextBox on the title bar of my application?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Location
    Syria, country of peace
    Posts
    65

    How can I put a TextBox on the title bar of my application?

    Hello, I saw an example(not designed with .Net)

    which has a TextBox on the title bar of the window

    (next to system buttons - min, max, close )

    can I do that in .Net and any how to do that?

    any help or code is appreciated.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How can I put a TextBox on the title bar of my application?

    There is no managed way to do that, so you'd do it essentially the same way it was done in your unmanaged example.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Location
    Syria, country of peace
    Posts
    65

    Re: How can I put a TextBox on the title bar of my application?

    aha, do you think that GDI+ can make sense for me?

    I mean to put that control in there.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How can I put a TextBox on the title bar of my application?

    Firstly, GDI+ will draw shapes but it's not going to help you create a TextBox. Secondly, the title bar is part of the non-client area of the form so GDI+ can't help you. To access the non-client area you need to use unmanaged code, which is why I said so in my last reply.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    413

    Re: How can I put a TextBox on the title bar of my application?

    I'm not a real good programer, but couldn't you hide the "real" Title bar and make your own on the form. You would have to create all the functionality of the real one, but would be able to add your own stuff.
    Visual Studio .NET 2005/.NET Framework 2.0

  6. #6
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: How can I put a TextBox on the title bar of my application?

    This is not easy. and as jmcilhinney correctly mentioned, there is no managed way to do this, that means we will need APIs

    I did something similar, but I added a button to the window's title bar - the whole logic surrounding it will be the same.

    There are plenty of examples on the internet on how to do this, If you say you couldn't find an example, you simply haven't looked hard enough. Check out this thread :
    http://www.codeguru.com/forum/showth...itlebar+button
    VB.NET MVP 2008 - Present

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