473,385 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Using a message box to open a web page. Problem, page always opens, even on CANCEL

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MessageBox.Show("2781 Beal St." & Chr(13) & "Deltona, Florida 32763" & Chr(13) & "" & Chr(13) & "View the Property Card?", "Property Address", MessageBoxButtons.OKCancel)
If Windows.Forms.DialogResult.OK Then Process.Start("IExplore.exe", "http://atlas.vcgov.org/VCMaps/palms/cgisearch.asp?pid=813032250290") Else
End Sub
Jul 21 '10 #1
1 1484
Joseph Martell
198 Expert 128KB
Windows.Forms.DialogResult.OK is an enumerated value. DialogResult is the datatype. This statement:

Expand|Select|Wrap|Line Numbers
  1. If (Windows.Forms.DialogResult.OK) Then ...
is analogous to:
Expand|Select|Wrap|Line Numbers
  1. If (5) Then ...
Your code needs to be something like the following:

Expand|Select|Wrap|Line Numbers
  1. If (MessageBox.Show("2781 Beal St." & Chr(13) & "Deltona, Florida 32763" & Chr(13) & "" & Chr(13) & "View the Property Card?", "Property Address", MessageBoxButtons.OKCancel) = Windows.Forms.DialogResult.OK) Then
  2.   Process.Start("IExplore.exe", "http://atlas.vcgov.org/VCMaps/palms/cgisearch.asp?pid=813032250290")
  3. Else
  4.   End Sub
  5. End If
  6.  
You are trying to test the user's response to the dialog box which is returned as a DialogResult type from the Show method.

Also, putting your examples in code tags helps with readability tremendously. Just a recommendation for the future.
Jul 23 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Matt | last post by:
My problem is when the user click the submit button, it will launch another new window for the request page. I want to confirm we cannot use JavaScript open window functions to open a request page?...
10
by: amit.purohit | last post by:
hi, I have a very strange problem on my login Page. the Page was working fine a few days back, but now does not generate post back events for controls. this login page uses form based...
9
by: ALI-R | last post by:
I want when user clicks on LinkedLable ,an IE page to an specific address opens ,how can I do that? thanks
3
by: Peter | last post by:
Hi I am very new to ASP development and I have a problem that I have spent days on and cannot find a solution. Any help would be gratefully accepted. I am using VB.NET to develop a ASP.NET...
3
by: | last post by:
Hi I am using vb.net code behind. In my code I have a button click event on my main web form. Private Sub btNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
2
by: savvy | last post by:
I'm performing a particular word Search in MS Word, Text, PDF docs and displaying the results through Index Server linked to SQL Server when it is matched. For which I'm using Openquery in the...
4
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. -...
4
by: =?Utf-8?B?YmlsbA==?= | last post by:
i'm using VS2005, VB.NET windows forms application when I try to open a web page using process.start, i get an error: "application not found" I'm using this syntax: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.