How To Center Align the Title Bar text In Windows Form?

前端 未结 4 802
不思量自难忘°
不思量自难忘° 2021-01-03 04:00

I am developing a Windows Form Application. I want to Align the Text to Center or say to Right of Title Bar of Form. How can I do it ??

4条回答
  •  -上瘾入骨i
    2021-01-03 04:02

    If it's a text that's inside a control (Like a label), you can edit the property named "TextAlign" to accomplish what you want inside Windows Form Designer.

    Or programmatically,

    Label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
    

    If you're talking about aligning the text of the title bar, there is no way to do this through Winforms. You will have to use something like this: http://www.codeproject.com/Articles/93959/WinForm-Extended

提交回复
热议问题