I need to perform a mask on a label , How Can I do that ?
I've tried to use RadMaskedTextbox but the problem is that if I disable that control the text is Gray And I need it to be red
If you need to make a textbox disabled but retain coloration, use the readonly property instead of disabling it.
Related
I have created a text box in run time using XAML. I need to make the text box as read only. So I have used a code Browsable[True] & ReadOnly[True] to achieve this.
So now the style of the text box is changed. Initially, the data in the text box were in bold. But now it is bit lite not in bold text. Now how to make it as bold. Thanks much.
[DisplayName("Name"), Browsable(true), ReadOnly(true)]
Setting the textBox as readonly does change it´s design and once you have set it as readonly you cant modify it´s content. What about using a Label instead, the user cant modify a Label´s content ever and that´s bascically what you achieve by setting the textBox as readonly.
Adding the Browsable property to the read only property makes the text box as Read only while generated on run time in WPF.
[Browsable(true), ReadOnly(true)]
Is it possible some how to make the Text of the Textbox invisible or to hide it so the user can't see it , yet it get's the input/keys from the user?
It's better to rely on the built-in capabilities.
For instance, consider to use the TextBox.PasswordChar property.
You can set ForeColor = BackColor
Paste in your Properties -> Behavior -> PasswordChar symbol you need, empty blanks works too.
I have a TextBox disabled but would like the user to still be able to copy its content to the clipboard. However when IsEnabled is not set copy/paste is not allowed.
Is there a way to achieve this?
You're not really supposed to interact with a "disabled" control.
Instead, set the TextBox.IsReadOnly property to true.
If you want it to "look" disabled, you could set the background color to grey, like it is when it is disabled.
I have a richtextbox, when I leave it for example to go to another panel where I want to manipulate the selected text I can no longer see the selected text. Is there a way to make it still show the highlight?
Set the RichTextBox's HideSelection property to false.
I have a text box that when it is disabled the text in it is gray and kind of dithered. (This is the standard functionality.)
Is there a way to make this easier to see?
I have tried this:
txtBoxNumber.Enabled = false;
txtBoxNumber.ForeColor = Color.Black;
and that has no effect.
NOTE: This is a .net Compact Framework app, but I am not tagging the question with CF because I think it is the same for normal .net.
txtBoxNumber.ReadOnly = true;
// Then set your styles here...
HTH.
Why don't you make the TextBox.ReadOnly instead? That would allow the user to see & copy the textbox value, but not change it. A read-only textbox is usually rendered the same way as a normal textbox.
From MSDN:
You can use this feature instead of disabling the control with the Enabled property to allow the contents to be copied and ToolTips to be shown.
I often set it to read only or if you have to use disabled set the text box color to white and the font color to black.
Just make the text box Read-Only. And then if you need to set style, set it.