Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to enter ampersand (&) character in a TextBox without it being translated

Posted on 2008-10-13
5
Medium Priority
?
614 Views
Last Modified: 2012-06-27
Hi,
When I enter (for example) "Fred & John" in a TextBox, save that text and later recall it by reloading the text box, the single ampersand (&) character is not shown but instead is interpreted as a control char.

If I enter "Fred && John" and do same as above then a single ampersand is shown on subsequent reload of that TextBox.

In the past I did something to basically inform the system to treat that character like any other but I forget now what I did. Any help?

/Michael
0
Comment
Question by:gem56
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Accepted Solution

by:
tchamtieh earned 800 total points
ID: 22707725
Hi Michael,

I think you can just set the UseMnemonic attribute of a Label to "false" and see the magic. You might even be able to use the escape character as in \& but not so sure.

Good Luck.
0
 

Assisted Solution

by:Cosmos36
Cosmos36 earned 200 total points
ID: 22707953
How are you "saving" the text?

If you use a "string" variable, nothing should be changed when you write that variable back to the textbox. Example below:

1 Form
2 Buttons
1 Textbox

Public Class Form1
    Dim MyTextbox As String
    Private Sub BtnSaveAndClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSaveAndClear.Click

        MyTextbox = TextBox1.Text
        TextBox1.Clear()

    End Sub
    Private Sub BtnFillTextbox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFillTextbox.Click

        TextBox1.Text = MyTextbox

    End Sub
End Class
0
 
LVL 6

Expert Comment

by:carlsiy
ID: 22708365
First of all, is this saved in a database? secondly is this web or windows?
0
 

Author Comment

by:gem56
ID: 22708603
Hi guys,
I must appologise for my poorly described question and limited testing, I was in a real hurry.

I actually entered the text in one dialog via a TextBox and later showed the entered text via a Label, incorrectly. Setting the UseMnemonic attribute to "false" did the trick so thank you all for responding and of course tchamtieh for the answer.

Thanks,

0
 

Expert Comment

by:Cosmos36
ID: 22718358
No problem. I am glad to help out where I can.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question