Home All Groups Group Topic Archive Search About
Author
27 Feb 2006 5:35 PM
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....

Author
27 Feb 2006 6:25 PM
Herfried K. Wagner [MVP]
"James_Ptg" <Twinse***@hotmail.Com> schrieb:
>    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)
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
27 Feb 2006 6:57 PM
james
Show quote Hide quote
"James_Ptg" <Twinse***@hotmail.Com> wrote in message
news:uWkC%23Q8OGHA.740@TK2MSFTNGP12.phx.gbl...
> 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
Author
27 Feb 2006 8:50 PM
Galen Somerville
Show quote Hide quote
"james" <jjames700REMOV***@earthlink.net> wrote in message
news:ui1Qq%238OGHA.2828@TK2MSFTNGP12.phx.gbl...
>
> "James_Ptg" <Twinse***@hotmail.Com> wrote in message
> news:uWkC%23Q8OGHA.740@TK2MSFTNGP12.phx.gbl...
>> 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
>
>
I would have said "buried deep in the help"

GalenS
Author
27 Feb 2006 10:13 PM
james
Show quote Hide quote
"Galen Somerville" <galen@community.nospam> wrote in message
news:u6OQw99OGHA.2604@TK2MSFTNGP09.phx.gbl...
>
> "james" <jjames700REMOV***@earthlink.net> wrote in message
> news:ui1Qq%238OGHA.2828@TK2MSFTNGP12.phx.gbl...
>> 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
>


Yes, that is probably a more accurate description !  :-)

james
Author
27 Feb 2006 10:26 PM
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