471,338 Members | 1,275 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,338 software developers and data experts.

set default font when adding a new textbox to a windows form

Rex
Hi - Is there any way to set default Properties - so that when I add a
new textbox to a form - that that control wil start out using Arial
10 (for instance)?
Thanks!
Rex
Jun 27 '08 #1
3 3258
On May 24, 5:59 pm, Rex <RexForum3...@1000GentleBreezes.comwrote:
Hi - Is there any way to set default Properties - so that when I add a
new textbox to a form - that that control wil start out using Arial
10 (for instance)?
Thanks!
Rex
Hi,
If you want to change textbox's font size / family at runtime, you
have to create a new instance of font as follows:

textBox1.Font = new Font("Arial", 10);

And if you want to set it by default before launching your
application, just set font's properties in textbox's properties window
on VS IDE.

Hope this helps,

Onur Güzel
Jun 27 '08 #2
On Sat, 24 May 2008 10:59:07 -0400, Rex wrote:
Hi - Is there any way to set default Properties - so that when I add a
new textbox to a form - that that control wil start out using Arial 10
(for instance)?
Thanks!
Rex
I think if you sent the font on the Form rather than the text box then
each text box that is added to that form will be the same. If all of your
forms inherit from another form with a set font then all forms, thus text
boxes will follow the super Form.

j1mb0jay
Jun 27 '08 #3
Rex
Hi j1mb0jay - Thank you! You are exactly right - I just tried it with
one form. That was very helpful - thanks again,
Rex

On Sat, 24 May 2008 22:19:40 +0100, j1mb0jay <j1******@uni.ac.uk>
wrote:
>On Sat, 24 May 2008 10:59:07 -0400, Rex wrote:
>Hi - Is there any way to set default Properties - so that when I add a
new textbox to a form - that that control wil start out using Arial 10
(for instance)?
Thanks!
Rex

I think if you sent the font on the Form rather than the text box then
each text box that is added to that form will be the same. If all of your
forms inherit from another form with a set font then all forms, thus text
boxes will follow the super Form.

j1mb0jay
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

55 posts views Thread by Haines Brown | last post: by
reply views Thread by Sean Wilkins | last post: by
reply views Thread by Osvaldo Bisignano | last post: by
1 post views Thread by Pranil Kanderi | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.