Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello There,

 

I was wondering, I have this code

 

                
Dim ctrlTemp As Control
      For Each ctrlTemp In Me.Controls
        If TypeOf ctrlTemp Is TextBox Then ctrlTemp.Enabled = False
      Next ctrlTemp

 

This disables all textboxes on my form, but is there a way to change the colour of the font while it is disabled..

As the Greyish font makes it hard to read?

I tried ReadOnly .. but as ctrlTemp is a Control it doesn't have ReadOnly on it and I'm not to sure how to make it textbox and also work.

 

If someone posts a way for ReadOnly to work, can the colour of the font be changed in this?

 

Thanks

 

Dan.

  • *Experts*
Posted

If you want to use the ReadOnly property of the textbox then simpyl cast the control object to the TextBox object:

If TypeOf ctrlTemp Is TextBox Then DirectCast(ctrlTemp, TextBox).ReadOnly = True

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