473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 3325
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

55
by: Haines Brown | last post by:
I've been setting font-size 1em; as the default in my style sheets. Until now, that seemed to be ok. But now I'm beginning to wonder. My aim is to have an easily readable, but not overly large...
0
by: Sean Wilkins | last post by:
How do you resolve this issue? I reinstalled the Scirpting 5.6 exe and reinstalled the newest MDAC 2.8, what else can I do? Best regards, Sean D. Wilkins Microsoft Certified Professional...
5
by: me | last post by:
I have a Class Library that contains a Form and several helper classes. A thread gets created that performs processing of data behind the scenes and the Form never gets displayed (it is for debug...
0
by: Osvaldo Bisignano | last post by:
I have an important number of using statements that I must write again and again for each element of a proyect. Isn't there any way to centralize this using statements into one, or to set a list...
1
by: Nilz | last post by:
Hi all, I want to know is there any facility with UltraGrid with which we can attach a Windows form having a text box and 2 buttons, so that we can write in the textbox and on the click of ok button...
1
by: ECathell | last post by:
I am getting an unspecified error when adding a windows form to a project. New project, old project. Doesn't matter. Also happens for user control. All the message box says is Unspecified Error. ...
1
by: Pranil Kanderi | last post by:
I have a huge application with lots of custom controls. The app had a memory leak but fixed that by calling the dispose method where needed and now the user objects are very stable, when I am...
0
by: Nat101 | last post by:
We've recently upgraded to .NET Framework 2.0, and we' re running into a problem with our app's web launch. The first time our exe is launched from a link in Internet Explorer, IEExec.exe...
3
by: Chris Shenton | last post by:
I am setting up handlers to log DEBUG and above to a rotating file and ERROR and above to console. But if any of my code calls a logger (e.g., logging.error("foo")) before I setup my handlers, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.