Char & behaviour on controls - vb.net

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. (&&&&)

Related

SendKeys.send is sending a key, but the application is not interpreting this key as a command

I'm using SendKeys to send key strokes to a program.
This is my code:
If whandle <> 0 Then
User32.SetForegroundWindow(whandle)
System.Windows.Forms.SendKeys.Send("+")
End If
(I tried also SendWait() instead of Send())
This is my window hierachy shown by Spy++:
Althoug I can find window handle by title and loop through childs with User32.FindWindowEx, when debugging I just enter window handle as shown by spy++ (converting from hex to decimal) and I find that:
Correct window is found and brought to front.
But nothing happens with this particular program, called MetaTrader (if I use a notepad window keys are written in notepad).
So I guess I have one of these problems:
I'm doing something wrong with windows and subwindows (I don't really think this is happening as I tried all handles shown by Spy++).
SendKey("+") is not exactly like pressing the "+" key when window is active and there is some difference.
After calling to User32.SetForegroundWindow(whandle) if I really press the "+" key the desired effect happens, which is a zoom in, but not when it's my program doing SendKeys. I tried also with other keys that produce commands, like Q or A (all of them simple keys and letters).
From MS Docs
The plus sign (+), caret (^), percent sign (%), tilde (~), and
parentheses () have special meanings to SendKeys. To specify one of
these characters, enclose it within braces ({}). For example, to
specify the plus sign, use "{+}"
System.Windows.Forms.SendKeys.Send("{+}")

Radiobutton with RightToLeft and number leading Text moves number to end

I've got radiobuttons with .RightToLeft set to Yes. The .Text values of these start with a digit, followed by a space and more text. For some reason, either VS or .net or whatever is moving that leading digit to the end of the string.
Anyone know why and/or how to fix?
(edit) Just tried to put quotes around the .Text string, just in case. Results were unexpected:
You appear to be misusing the RightToLeft property, which is to support right-to-left languages like Arabic. To place the check mark to the right of English text, set CheckAlign to MiddleRight.

QLIKVIEW - Scatter chart - popup - right to left

Is there any way to set the text in the pop-up of the scatter chart to be from right to left?
Thanks.
As with many things in Qlik, there is no way to accomplish this directly through the properties dialog. However, you can manually mimic this by substringing a string of whitespace in your expression names. The below function will pad the left side of your label with whitespace.
Expression Label Dialog:
=Mid(' ',1,len(' ') - len('Exp Label')) & 'Exp Label'
The length of the whitespace string is however wide you would want you pop-up window to be.
You may want to store your whitespace string in a variable to make the label look less ugly.
'Exp Label' is whatever you want your expression label to be named. *It shouldn't be longer than your whitespace string.

How can I disable automatic string detection in VS2015?

I'm using VB.NET, and my code contains a lot of strings that very often have double quotes inside of them. My problem is that as I'm fixing the string to escape double quotes (replacing every '"' with '""' inside of the string) it messes with the proceeding code, temporarily assuming everything is a string (since the double quotes don't match up) and completely messing up the formatting of other strings. It assumes that the start of a following string is the end of the current string which causes the actual string to be interpreted and formatted as code, which I have to go back and fix (since it adds spaces and other formatting characters that shouldn't actually be there).
Is there any way to disable this behavior? I didn't have the same problem in VS2013. I've been looking under Tools > Options > Text Editor > Basic, but I couldn't find anything relevant.
Additional Information: I can just modify the strings in a separate text document to escape all of the double-quotes (which is what I've resorted to for now), but in VS2013 I could easily just copy/paste the strings directly into my code without it messing up proceeding strings by temporarily interpreting them as code due to the uneven count of double-quotes.
This behavior is especially problematic when manually adding double-quotes within strings, because if you don't escape them quickly enough (or make a brief typo when doing so), you get the same issue.
You might notice that for other languages, such as C++, writing a string on one line (even with an uneven number of double-quotes) does not affect proceeding lines. Having this same behavior for VB would be great, assuming that there's some setting to enable it.
Yes its an inconvenience.
What I usually do is put some non-used character (e.g. some unused symbol on keyboard, or Alt+{some number}) instead of double quotes. When I'm done building my string whatever way I want, I just finalize it with either bringing up the Find and Replace box and replace that character with two double-quotes. Or just put a REPLACE statement immediately following it, replacing that character with Chr(34).
Instead use Chr(34), or if you end up repeating strings at all, store them as a resource.

controlP5 textfield contents. Processing

I have a sketch in processing I am working on which contains a textfield and a submit button. When the submit button is pressed, a file with is created using the name given in the textfield. I want to make sure something has been entered into the textfield when the submit button is pressed, however, it appears that by default the string is not empty or contain white space and is not caught by if statements.
Is there any simple way to check that something has been entered in the text field without needing to resort to something like regex?
I am not sure I understood whether by default your string is not empty and also does not contain white space (which would make it an odd example). The best possible check I can think of is to trim whatever the entered string is and then check if it is empty:
if(enteredString.trim().length() > 0) println("The string is valid");
the trim() method trims leading and trailing spaces, so if there are only spaces they will be removed making the string empty. Also, since you are saving files you might want to check for invalid characters. With Processing (Java) you don't necessarily have to resort to regex since you can do stuff like these:
String s = "ashd/ah";
println(s.contains("/"));
println(s.replace("/","-"));
which will print:
true
ashd-ah