Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello all,

 

Based on certain situations, I want to change the Text on my command button to bold, similarly to the way non default values are bold in the property grid at design time.

 

When I try to change commandButton.Font.Bold it is read only. Thanks in advance for any ideas and/or suggestions.

Posted
button1.Font = new Font(button1.Font.Name, button1.Font.Size, FontStyle.Bold);

Anybody looking for a graduate programmer (Midlands, England)?
Posted

Changing command button text to bold at run time

 

button1.Font = new Font(button1.Font.Name, button1.Font.Size, FontStyle.Bold);

 

Thanks CAGS! This also works:

 

button1.Font = New Font(button1.Font, FontStyle.Bold)

Posted
True, there are several valid overloads, I'm just used to using the Compact Framework, which is very restrictive.
Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...