简体   繁体   中英

VB.net - Change Background of Disabled Form Element

I have a rich text box that I want to show as un-editable and un-selectable text. If I set Read-Only to YES and Enabled to NO , then I get the desired effect...

...except disabling the control changes the background color to the washed out grey. I'd like to keep the background color white.

I have tried:

RichTextBox.BackColor = Color.White

but that doesn't appear to do anything.

Any suggestions?

Not quite a duplicate of the other post, but @Hans' link provided me with the solution:

Private Sub RichTextSummaryBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles RichTextSummaryBox.Enter
    ARandomControl.Focus() 'I use a picturebox of the company logo
End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM