473,385 Members | 1,930 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,385 software developers and data experts.

Set Numeric Up Down Font in Runtime

Anybody knows how to set NumericUpDown's font in runtime.
I've tried ....

mlNUMERICUPDOWN.Font.Size = 10
But the system said that Property 'size' is 'ReadOnly'


Dec 27 '05 #1
3 1745

Yes, the *Size* property of the Font object is
read-only, but the *Font* object can be replaced, as in

nud.Font = New Font("Arial", 32, FontStyle.Regular)

Regards,

/JB

On Tue, 27 Dec 2005 15:09:38 +0700, "Kalim Julia"
<ka*********@gmail.com> wrote:
Anybody knows how to set NumericUpDown's font in runtime.
I've tried ....

mlNUMERICUPDOWN.Font.Size = 10
But the system said that Property 'size' is 'ReadOnly'


Dec 27 '05 #2
"Kalim Julia" <ka*********@gmail.com> schrieb:
Anybody knows how to set NumericUpDown's font in runtime.
I've tried ....

mlNUMERICUPDOWN.Font.Size = 10
But the system said that Property 'size' is 'ReadOnly'


\\\
Me.NumericUpDown1.Font = _
New Font(Me.NumericUpDown1.Font.FontFamily, 12.0F)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Dec 27 '05 #3
On Tue, 27 Dec 2005 13:03:45 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"Kalim Julia" <ka*********@gmail.com> schrieb:
Anybody knows how to set NumericUpDown's font in runtime.
I've tried ....

mlNUMERICUPDOWN.Font.Size = 10
But the system said that Property 'size' is 'ReadOnly'


\\\
Me.NumericUpDown1.Font = _
New Font(Me.NumericUpDown1.Font.FontFamily, 12.0F)
///


Out of curiosity: Would it not be more correct to write

nud.Font = New Font(nud.Font.Name, 14)

instead of FontFamily? If I go to the docs for FontFamily, I read
"A FontFamily represents a group of fonts that have a similar font
face, but may have different sizes and styles (for example, Arial,
Times New Roman, and Verdana)."

Is it possible that the current font (name) might be a member of a
font family, but not the default font (name), meaning that specifying
FontFamily could result in a different, albeit related font?

I suppose specifying the font family will work most of the time
when sticking to the standard fonts. Just wondering if it wouldn't
be safer to specify the font name instead - at least in this case
where the font name is already known to exist.

?

Regards,

/JB

Dec 27 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Philip K | last post by:
I was trying to use Soap serialisation to save some systems settings how ever it fails if the settings contain a Font object, works fine if the Font object is not in the object being serialised. ...
1
by: Jeff N | last post by:
It it possible to change a button's or text box's font size during runtime? When I try to build my application with this code: this.ActiveControl.Font.Size = "8.25"; I get this error message:...
2
by: tpaulson | last post by:
I have a couple of DIV's that I hide/display based on radio buttons. On the DIV's, I have multiple drop down boxes. The source shows that they are populated, but I can't make them drop down. Only...
3
by: scott | last post by:
Hello all, I am ripping my hair out over this and maybe someone could help. I have a site that has groups and subgroups of those groups that all have int id's. I am trying to have a...
0
by: vbvr | last post by:
I need to export a numeric field (TAX ID) from vb.net to Excel. The value gets converted to Numeric in Excel and leading zeroes are lost. I tried to use code posted on this site. But the style...
3
by: Joseph Gruber | last post by:
Hi all -- I have two questions. First, I'm adding a control to my form at runtime and the control/form seems to ignore the anchor property of the runtime control. Any idea how I can get a...
1
by: bbcline | last post by:
Hi all, I'm a newbie to the forum and a Javascript beginner, I'd appreciate some help with a drop down box issue. Is it possble to limit the options/attributes in a drop down box based on how the...
0
by: mjohnson0321 | last post by:
I am trying to incorporate a CSS drop-down menu into a site (suckerfish menu). The menu gets lost behind the content below it, but only on one of the drop downs (News). The error occurs on all of...
2
by: registry | last post by:
<%@Language="VBSCRIPT" CODEPAGE="1252"%> <html> <head> <title>Registry Network Hospital Detail</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.