Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

When i click on Button1, TextBox1.Enabled = False, which naturally makes the text in TextBox1 appear in light grey, which is not very easy to read.

Is there a way that you can change the font once that the enabled property is set on False?

(I don't want to use the ReadOnly property)

 

Thank you! :)

  • Administrators
Posted (edited)

Don't have . Net handy now but can check later - but why don't you set the font and then disable the control?

 

TextBox1.Enabled = False
       TextBox1.Font = New Font(FontFamily.GenericSerif, 12, FontStyle.Bold, GraphicsUnit.Point)

 

edit : added code snippet, works even if you disable the control first

Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

Well, once the control is disabled, i cannot set the font anymore...

I've pasted your code and the textbox stays desperately gray...

 

It seems that once the control is disabled you cannot change its properties...

 

Heeelp!

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...