I am designing an calculator interface with visual studio 2013.I need to enclose "{" and "}" braces as two buttons in calculator.But when "{" button include as the button content,there is an error saying "mark up extension does not properly called".How can I enter the "{" brace just as a sign in the content field.
Thanks.
In XAML you can escape the curly brace by adding extra opening and closing curly brace like this:
<Button Content="{}{This is a text with curly braces}" />
Or you can use the extended version without any escaping:
<Button>
<Button.Content>
{This is a text with curly braces}
</Button.Content>
</Button>
Related
I'm new to using stackoverflow and using WebStorm quasar,and vuejs, so let me know if you need any more details or if I did something wrong.
pictures of code errors:
https://drive.google.com/drive/folders/13oSjnK6Q21ztsihbcF0a-TUUAWAo0vcW?usp=sharing
errors:
ESLint: A space is required after '{'.(object-curly-spacing)
enter image description here
ESLint: Unexpected whitespace between function name and paren.(func-call-spacing)
I correct these errors by adding the correct spacing, but whenever I refresh the website, I'm working on, WebStorm changes them back.
I believe its some sort of a formatting error.
I've gone into,
Settings->Editor->Code Style -> JavaScript
Settings->Editor->Code Style -> TypeScript
and clicked on spaces, and check the appropriate boxes.
spaces - before parenthesis - function call parenthesis
spaces - within - object literal braces
but the problem still persists.
You should have disabled the Spaces > Before parentheses > Function call parentheses and enabled the Within > ES6 Import/Export Braces in Settings | Editor | Code Style | JavaScript; please also make sure that you don't have the IDE code style preferences overwritten by the settings in project .editorconfig (if any)
I am trying to add an ampersand like this:
<Label Text="Phrase & Meaning Visible" />
This doesn't work so I tried to delimit with a \ and that also does not work. Does anyone have any suggestions on how I can do this?
Actually this question is not about XAML, it's just a pure XML question. Some characters need to be escaped in XML, the correct escaping of & is &
Taken this with thanks from the following blog post.
Special Symbols in XAML
For Ampersand sign <Label Text="&"/>
For less than sign <Label Text="<">
For greater than sign <Label Text=">"/>
For double quotes <Label Text="""/>
i try to send symbol Through text box when i send (10%)+(20%) to notepad
the result 10+20 !not (10%)+(20%)
this is the code i use
SendKeys.SendWait("TextBox1.Text")
According to the documentation the plus sign, percentage symbol and parentheses have a special meaning in the context of SendKeys. You need to enclose those symbols in curly braces.
SendKeys.SendWait("{(}10{%}{)}{+}{(}20{+}{)}")
You could use the String.Replace method to do the mapping for you, e.g. text.Replace("+", "{+}") etc.
If you read this link you find:
The plus sign (+), caret (^), percent sign (%), tilde (~), and
parentheses () have special meanings to SendKeys. To specify one of
these characters, enclose it within braces ({}).
So you have to change your text to be:
SendKeys.SendWait({(}10{%}{)}{+}{(}20{%}{)})
In IntelliJ IDEA 11 or 12, with an HTML file open, typing
<img src=
causes automatic insertion of double quotes, resulting in
<img src=""
Since I type ahead of where I read, this usually means I end up with something like
<img src=""image.png" alt="Image"/>"
How do I prevent double-quotes from being inserted automatically after attribute names?
In Intellij IDEA 14 and 15 (see #Zook's comment for IDEA 13), the option is now
Windows:
Menu File→Settings→Editor→General→Smart Keys→Add quotes for attribute value on typing '=' and attribute completion (under XML/HTML section on the right side of the Settings dialog)
Mac:
Preferences→Editor→General→Smart Keys→Add quotes for attribute value on typing '='
I don't know if it was the same for previous versions, but what actually happens in IDEA 14 is it automatically inserts both quotes and puts the cursor inside them. That's fine, but then when you type what you expect to be your opening double-quote, the smart punctuation mechanism thinks you're closing the quotes and skips you over the automatically-inserted close quote (the same as it does in e.g. java code when you type a closing parenthesis when it has already auto-inserted one). So you wind up with the cursor after the pair of quotes, typing your attribute value. This seems consistent with the original observation.
I would actually consider this a bug in IDEA but I guess the fact that opening and closing punctuation are the same symbol in this case makes things complicated. The smart punctuation mechanism would need to know to ignore the first quote you typed, but if you actually wanted to type an empty attribute value like src="", it would need to ignore the first quote and then jump over the close quote for the second one. Fiddly, but not impossible.
I've tried it with IDEA 12 and double quotes are inserted only after you start completing src attribute and press Enter or type = to confirm the completion. It doesn't happen automatically, you invoke completion that inserts quotes.
There is no option to control it, so you will have to break your habit to insert quotes manually and use Enter instead.
It's also possible to use the template completion with:
imgTab to generate <img src="" alt=""> with the caret inside first pair quotes.
Then just enter the image file name, Tab, enter alt text.
You can always submit a feature request to disable adding quotes on attributes completion.
Just change Input Language from "US - International" to "US". Switching to just "US" fixed the problem.
Read IntelliJ thread
I'm trying to build an MSBuild script that maps a network drive to a drive letter in the script, but unfortunately the path to the target folder includes an embedded space. The embedded space causes the mapping to fail, and I don't know if it is possible to escape quotes around the path. I've tried double quote marks, but MSBuild doesn't like it (either that or Windows XP doesn't like it). Anyone know how to code this beast so the map works?
<Exec Command="net use x: \\ofmapoly703\c$\program files\ar\iap /user:$(UserID) $(Password)"
WorkingDirectory="c:\"
ContinueOnError="false"
/>
The embedded space of course occurs in "program files".
Use " to encode the double quotes that you want net to see inside the Command attribute value :
<Exec Command="net use x: "\\ofmapoly703\c$\program files\ar\iap" /user:$(UserID) $(Password)"
WorkingDirectory="c:\"
ContinueOnError="false"
/>
You can use single quotes for command ,e.g.
<Exec Command='explorer.exe "$(DestinationDir)"' IgnoreExitCode="true" />
(From MSBuild exec task without blocking)
Escape the quotation marks - instead of "foo bar baz", use %22foo bar baz%22.
The hex value of " is 22.
References
Escape special characters in MSBuild
MSBuild special characters
As detailed by #Michael-Freidgeim the solution to this is to single quote, however you still have issue with trailing slashes (in Paths) being treated as escape characters in certain circumstances, a good method to avoid that would be to follow any folder paths with a dot (.)