Jump to content

How to font became red?

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Buffer_overflow

Buffer_overflow

    Newbie

  • Members
  • PipPip
  • 10 posts
Something like this i need in VB2008
Port 1 is closed <---red color
Port 2 is closed <---red color
Port 3 is closed <---red color
Port 4 is open <<---green color
Port 5 is closed <---red color
Port 6 is closed <---red color

How can i make it?

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 856 posts
  • Location:Arkansas
Depends on if you're writing a console application or a GUI application.

If you are writing a GUI app, just set the ForeColor property of the control you wish to change color on. Like this:

labelSomeLabel.ForeColor = Color.Green

or

labelSomeLabel.ForeColor = Color.Red


The Color class is in System.Drawing, so make sure to import that.

If you're writing a console app, all you have to do is set the ForegroundColor property of the Console class, like this:

Console.ForegroundColor = ConsoleColor.Red;

Console.ForegroundColor = ConsoleColor.Green;



#3
Buffer_overflow

Buffer_overflow

    Newbie

  • Members
  • PipPip
  • 10 posts
So manyy thanks , you helped me a lot!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users