Beginner question.

  • Thread starter Thread starter JD
  • Start date Start date
J

JD

How do i make the text in a button bold when it is
clicked?

I have tried
me.font.bold = true

but this does not work. Can anyone explain to me what i
am doin wrong??
 
Me refers to the form...you'll need to set the Font Property of the button
b/c The Bold property of the font is a boolean and read only.

myButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
 
Hi William,

thx for the code example. Is this the only way to make
the text bold? Im used to vb6

mybutton.font.bold = true

can i not do this in vb.net?

I tried to edit your code to just make the text bold
rather than set the fontstyle etc, but it did work!

this is what i tried..

myButton.Font = New System.Drawing.Font
(System.Drawing.FontStyle.Bold)

I not to clear on what the rest of the code does!!

How do i make the text non-bold? do i use the true and
false values of the bold property?

thx
-----Original Message-----
Me refers to the form...you'll need to set the Font Property of the button
b/c The Bold property of the font is a boolean and read only.

myButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, CType(0,
 
JD said:
Hi William,

thx for the code example. Is this the only way to make
the text bold? Im used to vb6

mybutton.font.bold = true

can i not do this in vb.net?
No.

I tried to edit your code to just make the text bold
rather than set the fontstyle etc, but it did work!

this is what i tried..

myButton.Font = New System.Drawing.Font
(System.Drawing.FontStyle.Bold)

This creates a deafult font with FontStyle.Bold.

I not to clear on what the rest of the code does!!

Create a spesific font with it's name and size spesified which is also bold.
How do i make the text non-bold?

myButton.Font= New System.Drawing.Font(myButton.Font,0)
do i use the true and
false values of the bold property?

No, just for reading them
 
Back
Top