We have a project that is using labels as buttons. The only issue is the text gets selected when people click the button sometimes. A hack was to set focus to another control on the label click event but we would like a more elegant (java?) based solution.
I need to use web labels due to the regular web buttons not supporting multiline which is imperative for our solution. Does anyone know of any solution for this?
Probably this is caused by the fact that Windows endofline is a CR and a LF, while on a Mac or Linux endofline is only a LF causing the browser to interpret the linefeed as a instead of new line.
The caption editor in the IDE also only inserts a LF for going to a new line.
[quote=251356:@Andre Kuiper]Probably this is caused by the fact that Windows endofline is a CR and a LF, while on a Mac or Linux endofline is only a LF causing the browser to interpret the linefeed as a instead of new line.
The caption editor in the IDE also only inserts a LF for going to a new line.[/quote]
Under Windows, EndOfLine is CR+LF.
Fact is, in HTML, endofline is simply not interpreted, and has to be replaced by
or .
Here, with 2015R4.1 under Windows 10 build 14271, endOfLine is interpreted by Xojo as , and what I see in Edge and Chrome is
Michel,
I think we both are saying the same thing, however if you replace in my example the endofline with only CHR(13) you also get the caption in three lines. The problem is not the LF but the missing CR in the caption editor that enables multiline button caption.
Xojo does what is expected, translating the end of line in , but the browser does not interpret it correctly.
The issue is reported on the Internet, and some people suggested to do a line break in the HTML code in older posts. It seems that no longer works.
The mere fact that we do not get the same result shows there is an issue. In practice, I would recommend to stay away from less than 100% reliable methods.
Sorry if it does not work here,I copy and paste your code in a project. I cannot explain why. That is a fact I would have loved to find a workaround for.
“the text gets selected when people click the button sometimes. A hack was to set focus to another control on the label click event but we would like a more elegant (java?) based solution.”
Weblabel with MouseUp event, which traps the click. AND weblabel.enabled=false !
It works on my Chrome and doesn’t select the text!