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.
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.
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!
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..