C# Visual Studio 2017. Words changed order in text boxes and labels - textbox

I just started using Visual Studio 2017. I noticed a problem with text boxes, labels and the captions on forms. In a text box I programically stamp the date: System.DateTime.Now. It shows up as 'PM 2:15 12/20/2017' not '12/20/2017 2:15 PM'. I tried hard coding the date but the text box keeps rearranging it back to that first pattern. labels do something similar. The text for the label was 'Designated Date:'. At runtime the colon comes first, then the words asthis ':Designated Date'. In addition the text alignment property is opposite. It's set at right but shows at left. I googled this problem and couldn't find any thing on it. Can anyone help?

you can use any of these combinations
this.textBox1.Text = DateTime.Now.ToString("dd/MM/yyyy");
//or
this.textBox1.Text = DateTime.Now.ToString("hh:mm:ss");
//or
this.textBox1.Text = DateTime.Now.ToString("dd/MM/yyyy" +" "+ "hh:mm");
etc.

Related

How to format a text like bold/italic in UITextField in Swift iOS?

Here consider this image. I have taken a toolbar with icons for text formatting. After selecting that sentence if I hit B (bold) it should be bold. Even I need that too if I select bold then further text to be show as bold. Consider this textbox UITextField. Incase you have some good reference like github you are welcome. I have already spend two days in a row in SO but not get any proper solution. One bold function is enough for me.

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.

Set default text size/color for text boxes in Master Slide PowerPoint 2013

I'm working with a PowerPoint document which annoyingly sets all newly inserted text boxes' color to Red and uses Century Gothic. I believe this is due to the Master Slide being used by the document.
I would like to remove this automatic setting from text boxes in the Master Slide but I cannot figure out how?
I have gone into the Master Slide view and found that there are no text physical text boxes, there are however "Text Placeholders" but no text boxes. I find it strange and wonder:
how are these newly inserted text boxes contain pre-set font type and color?
If you aren't trying to do this in code, StackOverflow isn't really the right place for the question; you want SuperUser for "How do I ..." questions that don't involve code.
But what you want to do is select a text box that's formatted the way you want default text to be, then right click it and choose Set As Default Text Box. You won't get that option if you've clicked WITHIN the text box and have an insertion cursor; in that case press ESC, then rightclick.
If you're trying to do this in code, select a text box formatted to taste then do something like this:
Sub SetMeAsDefault()
Dim oSh As Shape
Set oSh = ActiveWindow.Selection.ShapeRange(1)
With oSh
.SetShapesDefaultProperties
End With
End Sub
The shape and text box defaults are independent of master formatting, which controls only the formatting of placeholders and text within placeholders. Text/shapes inserted via the Insert ribbon/menu follow the defaults set for the presentation as I've described above. Each presentation (and template) can have its own set of defaults.

Replace keywords by images in TextField

I have some textfield with text like "Click #button1, then #button2". Have you got any idea how to replace keywords by images ? I must do it in AS2 :/ I know there is htmlText in textField, but useing it I can only use one image, and image can only align left or right site.
Very advanced stuff. I can tell you there is no 'out of the box' solution like using html text fields or something similar. Especially if you want to mimic nearly html behaviour you have to code advanced routines that can : 1. recognize your keywords. You should google for tokenizers and 2. layout textfields according to occuring images and textblocks. Again, thats advanced!

How do you add a superscript character into a Powerbuilder textbox?

Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox?
That kind of depends on how you define "textbox", but in general the only way to mix normal and superscript text is with a richtext control. In PB 11.5, you can even use richtext as a column style.
Good luck,
Terry.
Yes. For the text control, you must select a font that has superscript characters (Arial does).
Go into the Windows Character Map (usually in the start menu under Accessories->System Tools) and select your font.
Then go to the superscript character that you want to place in your text control. Click it and then click the Select button to place it down in the character map text box.
Then click the Copy button.
Now you can return to PowerBuilder and paste this value into the properties window text area.
As long as the same font is selected for the DataWindow control as was selected in the character map it should show as your superscript character.
This same techinque can be done to include any of the Wingding type characters as well.
We ended up using two separate text fields. It's a butt-ugly solution, but it works. The superscript field has a smaller font and is nudged a little higher up.
I think newer PB versions support superscripts.
Thanks for the help.
Glenn
If you go to the character map - when you select your character it will show the keys to enter this character on the bottom right of the window.
Example : in Arial font - the ® (registered) mark is Alt + 0174
To enter these, turn your numlock on, hold the alt key down, and type 0 1 7 & 4 then let up on the alt key. You have to use the number keys on the number pad to do this the ones on the top of the keyboard dont work.
You can then enter your characters directly or do something like this :
ls_key = '®'
Actually I stumbled across a simpler solution. I copied and pasted a portion of the text from a pdf into the text property of a datawindow text contol. The superscript character simply pasted in. So I'm guessing that Dougman's solution would work too.
Example:
"™Trademark used under..."
Note: I'm using PB 9.0.1
Thanks for all the help,
Glenn

Resources