472,954 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 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 3312
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.