CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    42

    Add text to WinForm title bar

    I am trying to add a text to the title bar of a Windows Forms. With other words, left to the minimize box in the title bar I want to display a text in italic (NOT the Form.Text property!). I guess I should be using the WM_NCPAINT message in the overridden WndProc. For some reason I cannot get it work. I am using Vista. Does anyone know this? Thanks.

  2. #2
    Join Date
    Oct 2008
    Posts
    51

    Re: Add text to WinForm title bar

    Do you mean?
    Code:
    Form1.ActiveForm.Text = "Fish";
    You have to referr to the spesific instance of the form object that you have created, in this case form1 and then select the active form's text.

  3. #3
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Re: Add text to WinForm title bar

    I think the format of the title area of the form is decided by the user's Display Properties/Appearance setting. Eg, they may be slightly blind and have large fonts chosen etc.. Not sure if it is a 'desired' idea to mess with that on a program by program basis, rather leave it system-wide. But you have me experimenting myself now!
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Add text to WinForm title bar

    I don't think that is at all possible, even with overriding the Paint message. Best would be to create your own window to be used as the titlebar, and just manipulate it accordingly..

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

Featured