Interview Question in Visual Studio 2005


 

Interview Question :: Visual Studio 2005 - Custom Font Size of a Textbox/Object Via Code

'm using visual studio 2005, i'm doing a project in college and fairly new to the program. i'm using visual basic language (no C,c++,java, ect)

I currently have:

Dim number As Integer
number = Int(NumericUpDown1.TextAlign)
TextBox1.Font = New Font(FontFamily.GenericSansSerif, number)

Originally i only had:
TextBox1.Font = New Font(FontFamily.GenericSansSerif, 12.0F)
'This Worked Fine but limits me to only changing the font to one size per line of code.

The code i have now doesn't work, but its the area i'm looking at to fix the problem. i basically want the font in txt1 to be the size that is in the numeric value in txt2.

eg, txt2 = 12, then txt1's fontsize = 12

Any help would be greatly apreciatted.
Otherwise only thing i can think of is to create 72 different lines of code just for this :(
by ksk