How to change the color of some text in textbox - Silverlight 3? - silverlight-3.0

I have a usual TextBox. I know in order to change the color of some text I can use Run tag. But when I try to use it imperatively instead declaratively (because I need to do that dynamically) I have the text in TextBox like
AAA<Run...>Text to be changed in color</Run>
and sure nothing in color changes.
How can I change the color of some text in some program way?
Thanks

I'm fairly sure you have to use a RichTextBox for that, TextBox only works with plaintext.

Related

Is it possible to change the color of a MaterialDesignIcon?

I use a MaterialDesignIcon in a label like this:
Label info = new Label("Label", MaterialDesignIcon.AC_UNIT.graphic("-fx-fill: red;"));
I don't know what CSS is supports (https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html) but I thought it was Text. -fx-underline worked and so did -fx-font-size. I understand that other font properties don't always work because the font doesn't support them, so that's fine. None of the Shape properties worked so the above fill doesn't do anything.
I only see the colors change by the Swatch but I want something local. What CSS properties are supported and how can I change a single icon's color?
MaterialDesignIcon.graphic() creates an instance of Label. So to change its color you can use fx-text-fill: red.
To inspect your GUI you can use ScenicView

Delphi combobox csOwnerDrawFixed set text property

I am using the csOwnerDrawFixed style to incorporate my style into a TCombobox. The problem is that I can no longer use the Text Property. I suppose it is read only. Is there a way to enable the text property?
No this is not possible. What you are observing is a simple reflection of the underlying Win32 control's behaviour.
When you select the csOwnerDrawFixed style that is mapped to the combo box CBS_OWNERDRAWFIXED style. And when a combo box has that style, then WM_SETTEXT always fails with CB_ERR, and WM_GETTEXT always returns an empty string.
The reason for this is that when you use the csOwnerDrawFixed style then the combo box does not have an associated edit control. Therefore there is nowhere for it to store window text. You only get an associated edit control if the combo box style is csDropDown or csSimple.

Removing Formatting from Text Box Controls - InfoPath

I'm working in InfoPath and somehow created about 16 Text Box Controls with formatting that I cannot override in terms of text size as well as strikethroughs. Any suggestions to be able to remove the formatting and be able to maintain these controls?
It sounds like you got into the code and accessed the toolbar. If you right click on the textbox and go to properties it should take you to the properties window. Make sure under the space next to "Text" in the properties window is blank.

data-placeholder and jQueryUI autocomplete

Is there a simple way to have a default text in the textbox using jQueryUI's autocomplete ?
I have tried using data-placeholder but it doesn't seem to work.
I have searched online, and people suggest using the textbox value to display the text, and clear it on focus. But then I would need to change the font style just for the default text, and check onKeyUp when the text is manually erased etc...
Is there no easier way to do this ? or am I missing something ?
A lot of people will use a span that is positioned to be over the text box. When the text box gets focus then you hide the span. When the text box blurs and has a value, you don't show it. If it doesn't have a value then you can show it again.
You can style the span however you want independently of the text box so you would not have to change the font style on the text box itself. You would have to subscribe to the focus and blur events, but it would be much easier if you created a jQuery plugin to do this. In fact, I'm sure there are ones that already exist that do this.

Button on jQuery UI

I am writing a script using jQueryUI's button http://jqueryui.com/dialog/#modal-form.
The button is pretty fancy looking.
Now, when I tried to use jQuery to change the display name of the button:
$('#signin').text("new name");
The Button revert to the original style of the browser, with no padding and etc. I don't know why change of style happens when I just change the display name of the button. Please suggest me a way to fix it.
To change button text use this :
$('#btnId').val('new-text');
I figured out how. I used a span tag around the display name and just change text of that span tag.

Resources