Mac
Mac

Reputation: 157

How to hide a particular text in a textbox for wp7

In my web browser app for wp7, i have a textbox for the URL's(named as UrlTextBox), in that i don't need the http:// to be visible even when the page is navigating or navigated. I don't know how to hide a particular text in a textbox. If i try to omit the http:// permanently then there will an error in my app. Can anybody help me with this? Thanks in advance for your help!

Upvotes: 0

Views: 167

Answers (1)

Matt Lacey
Matt Lacey

Reputation: 65556

I'd guess you're probably doing something like:

webBrowser.Navigate(urlTextBox.Text);

Instead you could just do:

webBrowser.Navigate("http://" + urlTextBox.Text);

Obviously with appropriate checks, etc.

OR

if (urlTextBox.Text.StartsWith("http://")
{
    urlTextBox.Text = urlTextBox.Text.SubString(7);
}

Upvotes: 1

Related Questions