私はどのようにC#によるWindowsアプリケーションのフォームのタイトルバーフォントを変更しますか?C#で勝利アプリのタイトルバーフォントを変更するには?
このコードは見つかりましたが、動作していません。タイトルバーを表示しません: どうすればいいですか? おかげで、すべての
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);
に提供する答えを見てみましょう。 – RobinJ
Coulb be、そうなら、私は手がかりを持っていません... それはちょうど私が考えていたものでした。 –