>Hi!
>In vb .net (2005) i want when a user clicks a button it's font become bold.
[quoted text clipped - 8 lines]
>
>what's wrong with me?
When you get an error, you should tell us what that error is. However,
it is clear what your problem is. Font attributes can not be changed.
You must create a new Font object:
Me.Button1.Font = New Font(Me.Button1.Font, FontStyle.Bold)
Herfried K. Wagner [MVP] - 21 Jan 2008 15:17 GMT
"Jack Jackson" <jjackson@cinnovations.net> schrieb:
> When you get an error, you should tell us what that error is. However,
> it is clear what your problem is. Font attributes can not be changed.
> You must create a new Font object:
>
> Me.Button1.Font = New Font(Me.Button1.Font, FontStyle.Bold)
If the button does not have a 'Font' object assigned which is shared by more
than one control:
\\\
Using OldFont As Font = Me.Button1.Font
Me.Button1.Font = New Font(Me.Button1.Font, FontStyle.Bold)
End Using
///
This will dispose the old font after assigning the new one.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
You can't change a font properties. You have to create a new font instance.

Signature
HTH,
Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
> Hi!
> In vb .net (2005) i want when a user clicks a button it's font become
[quoted text clipped - 10 lines]
>
> Best wishes.