button in bold

J

James_Ptg

Hello peole,

i'm begin with VB.NET (before i was under ASP and VB)

i have a -CheckBox- turned into a button with him properties Appearance.

so i whant that the text become in Bold so i have Write This ->

checkbox1.Font = New Font(checkbox1.Text, chkdef.Text)

But that dont work :-( so how i can simply turn the texte into BOLD ?

Thank a lot people....
 
H

Herfried K. Wagner [MVP]

James_Ptg said:
checkbox1.Font = New Font(checkbox1.Text, chkdef.Text)

But that dont work :-( so how i can simply turn the texte into BOLD ?

\\\
Me.Button1.Font = _
New Font(Me.Button1.Font, Me.Button1.Font.Style Or FontStyle.Bold)
///
 
J

james

James_Ptg said:
Hello peole,

i'm begin with VB.NET (before i was under ASP and VB)

i have a -CheckBox- turned into a button with him properties Appearance.

so i whant that the text become in Bold so i have Write This ->

checkbox1.Font = New Font(checkbox1.Text, chkdef.Text)

But that dont work :-( so how i can simply turn the texte into BOLD ?

Thank a lot people....

Here is a simple example:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click


With CheckBox1

.Text = "I'm BOLD"

.Font = New System.Drawing.Font("Arial", 10)

.Font = New System.Drawing.Font(CheckBox1.Font, FontStyle.Bold)

End With

End Sub



It's buried in the help (well, for me it was) Hope this helps.

james
 
G

Galen Somerville

james said:
Here is a simple example:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click


With CheckBox1

.Text = "I'm BOLD"

.Font = New System.Drawing.Font("Arial", 10)

.Font = New System.Drawing.Font(CheckBox1.Font, FontStyle.Bold)

End With

End Sub



It's buried in the help (well, for me it was) Hope this helps.

james
I would have said "buried deep in the help"

GalenS
 
J

james

Just to make it more fun,,,,,,,,,,,,here's this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

With CheckBox1

..Text = "I'm BOLD"

..Font = New System.Drawing.Font(CheckBox1.Font, FontStyle.Underline +
FontStyle.Bold + FontStyle.Italic + FontStyle.Strikeout)

End With

End Sub



Almost all the available settings except for FontStyle.Regular.
james
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top