المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : check for URL problem



C# Programming
03-27-2010, 07:24 AM
I am using this code when for activated to get the URL address but the Messagebox keeps poping up when user clicked Yes or No.. why it's not returning? where is my mistake?

private void frmLinksEntry_Activated(object sender, EventArgs e)
{
string url_address = Clipboard.GetText();

if (url_address != string.Empty)
{
try {
System.Uri xx = new Uri(url_address);

}
catch (FormatException exp)
{
return;
}

if (MessageBox.Show("Do you want to use the selected URL?", "Link", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
txtURL.Text = url_address;
}
}
}