Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

changing font size on run-time


  • Please log in to reply

#1
yusufozkay

yusufozkay

    New Member

  • Member
  • Pip
  • 2 posts
hi! how can i change font size of a label on run-time in c#(or .net)?
  • 0

Advertisements


#2
BuRnEr

BuRnEr

    Member

  • Member
  • PipPip
  • 48 posts
......
in C# newer forget that whenever you use "new" keyword that time you are telling the compiler do this work on the heap, not on the stack...
and second when ever you creat object with "new" keyword that means that object will be known at run time not compile time.
this rule is so important in C# .......
....you have to know this rule by hearth.
and also virtual methods are known at run time too

and there is your solution simply.
//create new windows form in vs and insert the codes in and run it .
static void Main() //this is inserted automaticly by vs.net designer
{
Application.Run(new Form1());

}
/*=====================================*/

//you must isert this variable and function ...

Brush b;
protected override void OnPaint(PaintEventArgs e)
{
Graphics g=e.Graphics;
b=new SolidBrush(Color.Red);
Font f=new Font("Times New Roman",30);
g.DrawString("BuRnEr",f,b,1,25); }

if you dont understand anypoint here just highlight thi word that you did not understand and press F1 key msn help window come up.
and if you want to se how it is work just press F10, for more detail F11...

i hope it will help you
take care
  • 0

#3
yusufozkay

yusufozkay

    New Member

  • Topic Starter
  • Member
  • Pip
  • 2 posts
Thanks!
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP