The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
When I set a TextBox to Readonly or set Enabled to false, the text color is gray. How can I force it to be the color specified in the ForeColor property of the TextBox. How would I do this in VB.net?
CBClay Burch Syncfusion Team June 1, 2002 07:45 PM UTC
For readonly, if you set the BackColor AFTER you set the ReadOnly property, then the cell will not look gray.
For Enabled = False, setting the BackColor will not get rid of the gray text, but will take care of the gray background.
For a disabled cell, if you really need to control the forecolor (& not just the backcolor), then one way to do this is to derive your own TextBox, override OnPaint and draw the text yourself using the paintevent arg passed in. This is doable, and works. You have to set the control's style to UserPaint with SetStyle in the constructor.