Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7610291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:23:01+00:00 2026-05-31T01:23:01+00:00

how i change title bar font of form in windows application by C# ?

  • 0

how i change title bar font of form in windows application by C# ?

i found this code but not working and doesn’t drawing titlebar:
how can i do this?
thanks all

protected override void WndProc(ref Message msg)
{
    base.WndProc(ref msg);
    const int WM_NCPAINT = 0x85;

    if (msg.Msg == WM_NCPAINT)
    {
        this.Text = "";// remove the original title text

        IntPtr hdc = GetWindowDC(msg.HWnd);
        Graphics g = Graphics.FromHdc(hdc);
        Font ft = new Font("Arial", 16);

        g.DrawString("Hello World title", ft, Brushes.Red, new PointF(20.0f, 0.0f));

        ReleaseDC(msg.HWnd, hdc);
    }
}

[DllImport("User32.dll")]
private static extern IntPtr GetWindowDC(IntPtr hWnd);

[DllImport("User32.dll")]
private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:23:02+00:00Added an answer on May 31, 2026 at 1:23 am

    On Vista and Windows 7 you will need to disable Aero for the code to work.

    Take a look at the answer I provided to the following question
    How to add an extra button to the window's title bar?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Windows Forms application that does not include a title bar, and
How do I change the font size for the title of the Action bar
I have gone through this to change the color of my title bar. I'm
Please suggest or change some suitlable title for this question as i am not
Iam creating an application like resource hacker. I want to change the title bar
In my android application I want the standard/basic title bar to change color. To
I change the title bar when the version of Android supports using the code
I have problem removing this title bar/image: I've tried theme change in manifest file
This code compiles, I just can't get the name to change on the title
I would like to change the style of the title bar and the form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.