473,769 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reproducing "&"

Hello,

Can you please help me?
To produce a "&"-sign on the screen, I use "&&". Otherwise I get an
underscore on the screen.
However, when a text is in a database, and I use the same field to reproduce
reports, the name in the report is written also with "&&".

So I want to have it both ways: on screen as well as on paper a single "&"
where a single "&" must be.
How can I achieve this?

Many thanks for your help,

Michel
Aug 1 '08 #1
12 1138
Michel Vanderbeke wrote:
Can you please help me?
To produce a "&"-sign on the screen, I use "&&". Otherwise I get an
underscore on the screen.
Do you mean when it appears in a menu? The ampersand is used in menus to
indicate that the next character is the keyboard shortcut for that menu
item.

Could you use the word "and" instead?

Andrew
Aug 1 '08 #2
Michel,

Probably you are from the BeNeLux and then from Flemish Belgium like your
name is Vanderbeke and you use as a kind of anonymous name Flupke. Can you
first tell us why the & gives an underscore on the screen. We would probably
use the same settings but I have never noticed that.

Cor

"Michel Vanderbeke" <Fl****@newsgro up.nospamschree f in bericht
news:uC******** ******@TK2MSFTN GP05.phx.gbl...
Hello,

Can you please help me?
To produce a "&"-sign on the screen, I use "&&". Otherwise I get an
underscore on the screen.
However, when a text is in a database, and I use the same field to
reproduce reports, the name in the report is written also with "&&".

So I want to have it both ways: on screen as well as on paper a single "&"
where a single "&" must be.
How can I achieve this?

Many thanks for your help,

Michel
Aug 1 '08 #3
Can you please help me?
To produce a "&"-sign on the screen, I use "&&". Otherwise I get an
underscore on the screen.
However, when a text is in a database, and I use the same field to
reproduce reports, the name in the report is written also with "&&".

So I want to have it both ways: on screen as well as on paper a single "&"
where a single "&" must be.
How can I achieve this?
You have to handle it manually. Access keys are automatically recognized by
the system when you're dealing with windows (in menus, dialog controls,
etc.) but for custom purposes you're on your own.
Aug 1 '08 #4
On Aug 1, 10:39*am, "Larry Smith" <no_spam@_nospa m.comwrote:
Can you please help me?
To produce a "&"-sign on the screen, I use "&&". *Otherwise I get an
underscore on the screen.
However, when a text is in a database, and I use the same field to
reproduce reports, the name in the report is written also with "&&".
So I want to have it both ways: on screen as well as on paper a single "&"
where a single "&" must be.
How can I achieve this?

You have to handle it manually. Access keys are automatically recognized by
the system when you're dealing with windows (in menus, dialog controls,
etc.) but for custom purposes you're on your own.
Set the UseMnemonic property to False.
Aug 1 '08 #5
Set the UseMnemonic property to False.

He didn't say he was using .NET but even if he is, that property only
applies to buttons and labels (not menu items for instance). How would it
help anyway.
Aug 1 '08 #6
On Aug 1, 12:14*pm, "Larry Smith" <no_spam@_nospa m.comwrote:
Set the UseMnemonic property to False.

He didn't say he was using .NET but even if he is, that property only
applies to buttons and labels (not menu items for instance). How would it
help anyway.
Well, yes, you are correct, although I might mention that it was
crossposted to the dotnet languages vb forum (from which I am
reading). On a button, UseMnemonic disables the automatic "hot-key"
that windows does and will present the & symbol without modification.
I had not realized the menu items would not have the same property, I
suppose I don't use them often enough.
Aug 1 '08 #7
"On the screen" is not enough ? We don't now if this is a Windows or Web
application and how it is displayed. Is this in a control menu, a label, a
textbox ? It all could cause distinct behaviors...

--
Patrice

"Michel Vanderbeke" <Fl****@newsgro up.nospama écrit dans le message de
groupe de discussion : uC************* *@TK2MSFTNGP05. phx.gbl...
Hello,

Can you please help me?
To produce a "&"-sign on the screen, I use "&&". Otherwise I get an
underscore on the screen.
However, when a text is in a database, and I use the same field to
reproduce reports, the name in the report is written also with "&&".

So I want to have it both ways: on screen as well as on paper a single "&"
where a single "&" must be.
How can I achieve this?

Many thanks for your help,

Michel
Aug 1 '08 #8
On Aug 1, 12:14 pm, "Larry Smith" <no_spam@_nospa m.comwrote:
Set the UseMnemonic property to False.

He didn't say he was using .NET but even if he is, that property only
applies to buttons and labels (not menu items for instance). How would it
help anyway.
Well, yes, you are correct, although I might mention that it was
crossposted to the dotnet languages vb forum (from which I am
reading).
I missed that.
On a button, UseMnemonic disables the automatic "hot-key"
that windows does and will present the & symbol without modification.
I had not realized the menu items would not have the same property, I
suppose I don't use them often enough.
It really depends on his needs. If he requires an access key in the same
string then he might wind up with this in his DB for example:

"Process && &Exit"

That beccomes "Process & Exit" when the user see it (with the ''E'
underlined). If he now dumps it to a report however then its his
responsibility to peform this magic himself. Of course he can always store
it as ""Process & Exit" instead and track the access key another way
(storing the offset of 'E' in a separate field for instance - when
displaying it on screen, he would then replace all single occurences of "&"
with "&&" and insert the access key "&" at the given offset - if he's
localizing it though then he'd have to store the offset for each language).
Aug 1 '08 #9
Michel Vanderbeke wrote:
Hello,

Can you please help me?
To produce a "&"-sign on the screen, I use "&&". Otherwise I get an
underscore on the screen.
However, when a text is in a database, and I use the same field to reproduce
reports, the name in the report is written also with "&&".

So I want to have it both ways: on screen as well as on paper a single "&"
where a single "&" must be.
How can I achieve this?

Many thanks for your help,

Michel
Strings often need different escaping depending on where it's used, for
example url encoding and html encoding.

In your case you need to escape the & character when you put the string
in a control by replacing it with &&.

You should store the text in the original form in the database, i.e.
with the single & characters, and do the replacement when you put the
text in the controls:

someControl.Tex t = textFromDatabas e.Replace("&", "&&")

--
Göran Andersson
_____
http://www.guffa.com
Aug 1 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
11443
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a href="mailto:DrTebi@yahoo.com">DrTebi</a> This would work like a regular mailto link in any browser, but wouldn't be visible to spiders if they don't have a function to decode it.
2
1851
by: DC Gringo | last post by:
I have an image control (that pulls an image off an ESRI map server): <ASP:IMAGE ID="imgZonedCountry" RUNAT="server"></ASP:IMAGE> In the code behind I am setting the ImageURL to a String value with url parameters like this: imgZonedCountry.ImageUrl = "http://server/servlet/com.esri.wms.Esrimap?param1=x&param2=y When it serves up the page, I'm getting "&amp;" in place of the "&"
2
20534
by: Eric Osman | last post by:
Hi, I'm looking for a javascript function that will convert input such as this: <CLUB Code=" into this: &lt;CLUB Code=&quot;
4
14803
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following expression: .... snip ...
1
3980
by: st | last post by:
Hi, I'm using xmlDocument.Save(xmlTextWriter) to create an Excel-readable file. All works well, except where I've replaced the carriage return chars in the .innertext to XML-compliant " "; It gets changed to "&amp;#10" and doesn't render new lines in the Excel sheet. Can anyone help? Many thanks,
5
3447
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot; &lt;me@mydomain.com&gt;</Address> </Addresses>
7
2806
by: DC Gringo | last post by:
I am having a bear of a time with setting a URL query string as a text value in a dropdownlist and Server.URLEncode does not seem to do its job. theFullLink = theLinkPrefix & theImageryTypeTrimmed & Server.URLEncode("&f=") ddlMyDropDownList.Items.Add(New ListItem("MyTextValue", theFullLink & "af")) Which puts out the following HTML: <option value="~/folder/page.aspx?param1=value1%26f%3daf">-
14
5935
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only because of this, so I hope some of you gurus can enlighten me with this :) In what circumstances can the "&amp;" in the source code be involuntary changed to "&" by a browser when or other software, when editing and uploading the file to the web...
13
2804
by: Ragnar | last post by:
Hi, 2 issues left with my tidy-work: 1) Tidy transforms a "&amp;" in the source-xml into a "&" in the tidied version. My XML-Importer cannot handle it 2) in a long <title>-string a wrap is produced like: <title>my very long title blab la blab la Blabla bla </title> Importer also has got problems with it
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.