button in bold

  • Thread starter Thread starter James_Ptg
  • Start date Start date
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....
 
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)
///
 
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
 
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
 
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
 
Back
Top