I want to create a TextBox for entering an ip adress. My first attempt was to use the InputScope parameter like this:
<TextBox Name="txtIpAdress" InputScope="Number"/>
The problem with that is that here in Denmark we use , (comma) Decimal Seperator and . (dot) as Thousand Separator, so when I show the numeric keyboard I got the numbers [0..9] + comma.
Can I some how force the numeric keyboard to show a . (dot) or can I show the regulare keybord and switch it over to the numeric mode ?
If you long press the dot key you will get the option which will have comma,dot and hyphen in the numeric keyboard. See the image below.
Related
I am aware about surrounding selection in quotes or braces
PhpStorm wrap/surround selection?
I need similar but surround selection into array
Assume I have text separated with newline or text separated with space
a
b
c
d
e
a b c d e
I need after selection get [a,b,c,d,e]
Please advice any IDE or method how to achieve this
A no-brainer solution
Make sure the following option is enabled:
For text separated with spaces:
Select the 'array-to-be', hit Ctrl+R and R again (to enter 'In selection' mode)
Type a space in the first field, , in the second
Click 'Replace all', hit Esc
With the text still selected, press [: the closing bracket will be added automatically
For multi-line text:
Select the 'array-to-be', hit Ctrl+R, enable 'Regex'
Type \n + in the first field, , in the second
Click 'Replace all', hit Esc
With the text still selected, press [: the closing bracket will be added automatically
The sequence of actions can be wrapped into a macro and assigned a single shortcut.
Vim + Surround plugin. Enter visual mode, select what you need and press S].
The first group could be created by:
:%s/\v(\w)(\n)*/\1,/g | exec "norm! I[\<Esc>A]"
It takes care of:
a
b
...
\v ........... very magic regex
() ........... regex group
(\w) ......... letters
(\n)* ........ zero or more line breaks
\1 ........... repeat content of the first regex group
I want to show comma sign center of six digits and have length of textbox 7. for example "123,456" like this.
The MaskedTextBox control would be an easy way to accomplish this.
Replace your TextBox by a MaskedTextBox, and try to set the Mask to something like this:
MaskedTextBox1.Mask = "##0,000"
It should make sure that your trailing zero are always showing.
Currerently I face strange behaviour on my controls when text is present either on advlistbox items or buttonx and probably rest as well. This happens when i use & charackter within string. For instance when i use double && it shows single one. Another example when i put e.g &&&something then it shows &something with s - underscored. Is there anyone whom knows what is going on and how can i avoid that situation?
A double ampersand is used to escape the default behavior of an ampersand relative to controls. When an ampersand precedes control text it underlines the following character, usually to denote that controls hotkey. In the case of your triple ampersand situation you are using the right most ampersand as the underline and the remaining 2 as an escape so that a literal ampersand is displayed in your controls text.
If your goal is to literally display 2 ampersands then you must supply your control text with a total of 4 consecutive ampersands. (&&&&)
I want to convert any special characters entered in infopath textbox into under score.Using the translate function, in the below example I am able to replace the space with under score
translate(fileName, " ","_")
Since translate function takes only three parameters then how can we check all the special characters? My target is if any special characters including space is entered into the text box it should automatically replace these special characters with under score ("_")
what if you reverse it. If it is not A-Z, then convert it
or try this:
translate(field1, "!##%^&", "_")
I have a text box control and I want to select a multiple ranges of text when i click on button.
for example:
the text is :"I want to select"
and I want that the selected words will be "want" and "select".
do you have an idea of how to implement this?
thanks,pavel.
Not sure if this is what you're looking for but:
var words = textBox1.Trim().Split(' ');
Then you have an array of strings of all words. . Trim() ensures that you don't have any spaces in front or after the 'sentence'.