hobbes2103 Posted September 5, 2003 Posted September 5, 2003 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! :) Quote
Administrators PlausiblyDamp Posted September 5, 2003 Administrators Posted September 5, 2003 (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 September 5, 2003 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
hobbes2103 Posted September 5, 2003 Author Posted September 5, 2003 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! Quote
Administrators PlausiblyDamp Posted September 5, 2003 Administrators Posted September 5, 2003 Unfortunately if the control is disabled then it always renders as grey. The only way to get round that problem is write your own Textbox control (Inherit from TextBox) and either provide your own method to handle locking the control. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.