Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Ctrl+E menu shortcut
Message
From
23/07/2008 00:58:03
 
 
To
22/07/2008 14:52:54
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01326710
Message ID:
01333381
Views:
10
>>Andrus, did you find a workaround for this yet? I toyed with it some this weekend and came up with something. Basically, in your TextBox class, you need to override the ProcessCmdKey and do some extra processing if the TextBox is ReadOnly:
>
>Thank you, this seems to be good hack. I never tought about this.


You're welcome. It seems to work ok.

>I have also another related issue for combobox: I need that in ReadOnly ComboBox:
>
>1. F12 key opens picklist
>2. ReadOnly combobox has nice, contract colors so that it does not look like disabled.
>
>Since combobox does not have readonly property, I mimic this by seting Enabled to false. This disables F12 key and makes combo colors ugly.
>
>There may be 2 workarounds for this:
>
>1. Trying to use your hack and also to change combobox disabled colors in some way.
>
>2. Emulate combox readonly property by adding some code to Keypress event as described in http://www.codeproject.com/KB/combobox/ReadOnly_Combo_Provider.aspx
>
>What is best solution for those issues ?


Probably the CodeProject solution, because he makes a good point about being able to copy the text from the Combo. We don't do that in our "Framework". All of our controls have a ShowEnabled property, that basically sets the control's enabled property, but also does additional stuff in the "set" like setting the colors.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform