{"id":713,"date":"2011-02-23T02:29:00","date_gmt":"2011-02-23T02:29:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vbteam\/2011\/02\/23\/visual-basic-windows-phone-7-series-1-how-to-create-a-mini-browser-application-for-windows-phone-7\/"},"modified":"2024-07-05T12:40:34","modified_gmt":"2024-07-05T19:40:34","slug":"visual-basic-windows-phone-7-series-1-how-to-create-a-mini-browser-application-for-windows-phone-7","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/vbteam\/visual-basic-windows-phone-7-series-1-how-to-create-a-mini-browser-application-for-windows-phone-7\/","title":{"rendered":"Visual Basic Windows Phone 7 Series #1. How to create a mini browser application for Windows Phone 7"},"content":{"rendered":"<p><span style=\"font-size: small\">I have experienced a lot of fun writing Windows Phone 7 applications in Visual Basic. <b>Web browser<\/b> is one of the applications that is commonly used on phones these days. In this blog post, I want to share some sample source code that will help you to create a mini browser application for Windows Phone 7. I will now demonstrate how easy it is to develop a mini browser application for Windows Phone 7, using Visual Basic for Windows Phone Developer Tools. <\/span><\/p>\n<p><span style=\"font-size: small\">The mini browser application can be created in 3 simple steps:<\/span><\/p>\n<ol>\n<li><span style=\"font-size: small\">Create a sample application and add controls and an event handler <\/span><\/li>\n<li><span style=\"font-size: small\">Build and debug the application <\/span><\/li>\n<li><span style=\"font-size: small\">Rebuild in release mode before publishing <\/span><\/li>\n<\/ol>\n<p><i><span style=\"font-size: small\">Before you create a mini browser application, you need to install the following applications:<\/span><\/i><\/p>\n<ul>\n<\/ul>\n<ul>\n<li><span style=\"font-size: small\"><i>Visual Studio 2010 Professional, Premium,\nor Ultimate. If you do not have any of the releases, you can download any of\nthe following trial versions as per your preference: <\/i><a href=\"http:\/\/www.microsoft.com\/downloads\/en\/details.aspx?FamilyID=26bae65f-b0df-4081-ae6e-1d828993d4d0&amp;displaylang=en\"><i>Professional<\/i><\/a><i>, <\/i><a href=\"http:\/\/www.microsoft.com\/downloads\/en\/details.aspx?FamilyID=7038e207-329c-4006-b620-16d1af1c42c1&amp;displaylang=en\"><i>Premium<\/i><\/a><i>, or <\/i><a href=\"http:\/\/www.microsoft.com\/downloads\/en\/details.aspx?FamilyID=e2a1a098-995e-4468-816d-7fdbe0a64f38&amp;displaylang=en\"><i>Ultimate<\/i><\/a><i>.<\/i><\/span><\/li>\n<li><span style=\"font-size: small\"><a href=\"http:\/\/www.microsoft.com\/downloads\/en\/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce&amp;displaylang=en\"><i>Windows Phone Developer Tools\nRTW<\/i><\/a><\/span><\/li>\n<li><span style=\"font-size: small\"><a href=\"http:\/\/www.microsoft.com\/downloads\/en\/details.aspx?FamilyID=4e97ea70-e479-4c05-814f-639d71690e5d&amp;displaylang=en\"><i>Visual Basic\nfor Windows Phone Developer Tools &#8211; RTW<br \/><\/i><\/a><em>Note: You can install the newer version- <\/em><em><a href=\"http:\/\/www.microsoft.com\/downloads\/en\/details.aspx?FamilyID=77586864-ab15-40e1-bc38-713a95a56a05&amp;displaylang=en\">Windows Phone Developer Tools 7.1 Beta<\/a> instead of the above mentioned two tools as it will take comparatively less time. However, this sample was created using the previous version. <\/em><br \/><\/span><\/li>\n<\/ul>\n<p><span style=\"font-size: small\">To create a mini browser application, follow the 3 simple steps mentioned earlier:<\/span><\/p>\n<h3>Step 1 &#8211; Create a sample application and add controls and an event handler<\/h3>\n<h4><span style=\"font-weight: bold\">Create a sample application<\/span><\/h4>\n<ol>\n<li><span style=\"font-size: small\">Create a new project and browse to the &ldquo;Silverlight for Windows Phone&rdquo; node. <\/span><\/li>\n<li><span style=\"font-size: small\">Select the &ldquo;Windows Phone Application&rdquo; template. <\/span><\/li>\n<li><span style=\"font-size: small\">Enter a name for the browser.&nbsp;<br \/><\/span><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/0250.VB_App_Selection.gif\" width=\"547\" border=\"0\" height=\"363\" \/> <\/li>\n<li><span style=\"font-size: small\">Click OK. The MainPage.xaml page is displayed.&nbsp;<br \/><\/span><a href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx\/$Application_Initial[1].png\"><\/a><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/8345.Application_Initial.bmp\" border=\"0\" \/> <\/li>\n<\/ol>\n<h4><span style=\"font-weight: bold\">Add controls<\/span><\/h4>\n<ol>\n<li><span style=\"font-size: small\">Click the MY APPLICATION text. In the Properties window, change the text property to &ldquo;MY FIRST APPLICATION&rdquo;. <\/span><\/li>\n<li><span style=\"font-size: small\">Click the page name text. In the Properties window, change the text property to &ldquo;Mini Browser&rdquo;. <\/span><\/li>\n<li><span style=\"font-size: small\">To enable the application to work in both the portrait and landscape modes, add the support for both the orientations. <\/span><\/li>\n<li><span style=\"font-size: small\">Click the first line of the XAML code. In the Properties window, change the SupportedOrientation property to &ldquo;PortraitOrLandscape&rdquo;. <\/span><\/li>\n<li><span style=\"font-size: small\">From the Toolbox, drag and drop the Textbox control to the design surface. <\/span><\/li>\n<li><span style=\"font-size: small\">Click the Textbox. In the Properties window, change the text property to &ldquo;http:\/\/www.xbox.com&rdquo;. <\/span><\/li>\n<li><span style=\"font-size: small\">From the Toolbox, drag and drop the Button control to the design surface. <\/span><\/li>\n<li><span style=\"font-size: small\">Click the Button. In the Properties window, change the content property to &ldquo;Go&rdquo;. <\/span><\/li>\n<li><span style=\"font-size: small\">From the Toolbox, drag and drop the WebBrowser control to the design surface. Place it below the other two controls you added earlier. <\/span><\/li>\n<li><span style=\"font-size: small\">Add the following XAML code to set the height, width, and the alignment of the WebBrowser control. This allows the control to position itself correctly in both the portrait and landscape modes. \n<div id=\"codeSnippetWrapper\" style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 94.95%;font-family: 'Courier New', courier, monospace;direction: ltr;height: 136px;max-height: 200px;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px\">\n<div id=\"codeSnippet\" style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;width: 127.94%;font-family: 'Courier New', courier, monospace;direction: ltr;height: 87px;color: black;font-size: 9pt;overflow: visible;border-style: none;padding: 0px\">\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">&lt;<\/span><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\">Grid<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> x<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">:<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\">Name<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;ContentPanel&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Grid.Row<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;1&#8243;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Margin<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;12,0,12,0&#8243;&gt;<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;<\/span><\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">&lt;<\/span><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\">TextBox<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Height<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Auto&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> HorizontalAlignment<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Stretch&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Margin<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;0,0,120,0&#8243;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Name<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;textBox1&#8243;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Text<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;http:\/\/www.xbox.com&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> VerticalAlignment<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Top&#8221; \/&gt;<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;<\/span><\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">&lt;<\/span><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\">Button<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Content<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Go&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Height<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Auto&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> HorizontalAlignment<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Right&#8221;<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\"> <span style=\"color: red\"><span>&nbsp;<\/span>Name<\/span><span style=\"color: blue\">=&#8221;button1&#8243;<\/span><span style=\"color: red\"> VerticalAlignment<\/span><span style=\"color: blue\">=&#8221;Top&#8221;<\/span><span style=\"color: red\"> Width<\/span><span style=\"color: blue\">=&#8221;Auto&#8221;<\/span><span style=\"color: red\"> Click<\/span><span style=\"color: blue\">=&#8221;button1_Click&#8221; \/&gt;<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;<\/span><\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">&lt;<\/span><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\">phone<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">:<\/span><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\">WebBrowser<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> HorizontalAlignment<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Stretch&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Margin<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;0,84,0,0&#8243;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Name<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;webBrowser1&#8243;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> VerticalAlignment<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Stretch&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Height<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Auto&#8221;<\/span><span style=\"font-family: 'Courier New';color: red;font-size: 8.5pt\"> Width<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">=&#8221;Auto&#8221; \/&gt;<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">&lt;\/<\/span><span style=\"font-family: 'Courier New';color: #a31515;font-size: 8.5pt\">Grid<\/span><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">&gt;<\/span><\/p>\n<\/div>\n<\/div>\n<p><\/span><\/li>\n<\/ol>\n<p><span style=\"font-size: small\">Your application now looks like this:<br \/><\/span><a href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx\/$Application[2].png\"><\/a><\/p>\n<p>&nbsp;<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/3187.Application.bmp\" border=\"0\" \/><\/p>\n<h4><span style=\"font-weight: bold\">Add an event handler<\/span><\/h4>\n<p><span style=\"font-size: small\">It is essential to add an event handler to the application because it helps to navigate to the entered URL. <\/span><\/p>\n<p><span style=\"font-size: small\">To add an event handler, do the following:<\/span><\/p>\n<ol>\n<li><span style=\"font-size: small\">Double-click the Go button. The MainPage.xaml.vb page is displayed with the following code: <\/span>\n<div id=\"codeSnippetWrapper\" style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 98.12%;font-family: 'Courier New', courier, monospace;direction: ltr;height: 154px;max-height: 200px;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px\">\n<div id=\"codeSnippet\" style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;width: 118.36%;font-family: 'Courier New', courier, monospace;direction: ltr;height: 174px;color: black;font-size: 9pt;overflow: visible;border-style: none;padding: 0px\">\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">Partial<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\"> <span style=\"color: blue\">Public<\/span> <span style=\"color: blue\">Class<\/span> <span style=\"color: #2b91af\">MainPage<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: blue\">Inherits<\/span> <span style=\"color: #2b91af\">PhoneApplicationPage<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green\">&#8216; Constructor<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: blue\">Public<\/span> <span style=\"color: blue\">Sub<\/span> <span style=\"color: blue\">New<\/span>()<\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>InitializeComponent()<\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: blue\">End<\/span> <span style=\"color: blue\">Sub<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\">&nbsp;<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\">&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: blue\">Private<\/span> <span style=\"color: blue\">Sub<\/span> button1_Click(<span style=\"color: blue\">ByVal<\/span> sender <span style=\"color: blue\">As<\/span> System.<span style=\"color: #2b91af\">Object<\/span>, <span style=\"color: blue\">ByVal<\/span> e <span style=\"color: blue\">As<\/span> System.Windows.<span style=\"color: #2b91af\">RoutedEventArgs<\/span>) <span style=\"color: blue\">Handles<\/span> button1.Click<\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\">&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: blue\">End<\/span> <span style=\"color: blue\">Sub<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">End<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\"> <span style=\"color: blue\">Class<\/span><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<li><span style=\"font-size: small\">Replace the button1_Click event handler with the following code. This method will take the URL that is entered in the Textbox control and navigate to that page in the WebBrowser control. <\/span>\n<div id=\"codeSnippetWrapper\" style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 98.15%;font-family: 'Courier New', courier, monospace;direction: ltr;height: 95px;max-height: 200px;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px\">\n<div id=\"codeSnippet\" style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;width: 117.49%;font-family: 'Courier New', courier, monospace;direction: ltr;height: 79px;color: black;font-size: 9pt;overflow: visible;border-style: none;padding: 0px\">\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">Private<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\"> <span style=\"color: blue\">Sub<\/span> button1_Click(<span style=\"color: blue\">ByVal<\/span> sender <span style=\"color: blue\">As<\/span> <span style=\"color: blue\">Object<\/span>, <span style=\"color: blue\">ByVal<\/span> e <span style=\"color: blue\">As<\/span> <span style=\"color: #2b91af\">RoutedEventArgs<\/span>)<\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: blue\">Dim<\/span> site <span style=\"color: blue\">As<\/span> <span style=\"color: blue\">String<\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>site = textBox1.Text<\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';font-size: 8.5pt\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>webBrowser1.Navigate(<span style=\"color: blue\">New<\/span> <span style=\"color: #2b91af\">Uri<\/span>(site, <span style=\"color: #2b91af\">UriKind<\/span>.Absolute))<\/span><\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: 'Courier New';color: blue;font-size: 8.5pt\">End<\/span><span style=\"font-family: 'Courier New';font-size: 8.5pt\"> <span style=\"color: blue\">Sub<\/span><\/span><\/p>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p><span style=\"font-size: small\">Voila! Your mini browser application for Windows Phone 7 is ready! Now you just need to build and debug the application.<\/span><\/p>\n<h3><span style=\"font-weight: bold\">Step 2 &#8211; Building and debugging the application<\/span><\/h3>\n<ol>\n<li><span style=\"font-size: small\">Select Build &gt; Build Solution. The project builds without any errors. If there are errors, check the earlier steps, correct any errors, and then build the application again. <\/span><\/li>\n<li><span style=\"font-size: small\">On the standard toolbar, set the deployment target of the application to &ldquo;Windows Phone 7 Emulator&rdquo;.&nbsp;<br \/><\/span><a href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx\/$Debug[3].gif\"><\/a><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/8547.Debug_.gif\" border=\"0\" \/> <\/li>\n<li><span style=\"font-size: small\">Debug the application by selecting Debug &gt; Start Debugging. This opens the emulator window and launches the application. You can now test the application easily using the normal Visual Studio debugger and emulator controls. <\/span><\/li>\n<li><span style=\"font-size: small\">Click the Go button and verify that the browser window navigates to the given web site.&nbsp;<br \/><\/span><a href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx\/$Portrait[1].png\"><\/a><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/8524.Portrait.bmp\" width=\"238\" border=\"0\" height=\"451\" \/> <\/li>\n<li><span style=\"font-size: small\">When you hover the cursor on the emulator, the edit panel of the emulator pops up. To test the application in the landscape mode, select the rotation control from the edit panel. <br \/><\/span><a href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx\/$Rotation Control[1].png\"><\/a><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/1727.Rotation20Control.bmp\" width=\"33\" border=\"0\" height=\"164\" \/><br \/><span style=\"font-size: small\">The emulator rotates into the landscape mode and accordingly, the controls resize themselves to fit the screen.&nbsp;<br \/><\/span><a href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx\/$Landscape[3].png\"><\/a><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/4846.Landscape.bmp\" width=\"486\" border=\"0\" height=\"247\" \/> <\/li>\n<li><span style=\"font-size: small\">Select Debug &gt; Stop Debugging to stop debugging the application. <\/span><\/li>\n<\/ol>\n<p><span style=\"font-size: small\">&nbsp;<\/span><\/p>\n<h3><span style=\"font-weight: bold\">Step 3 &#8211; Rebuilding for the release before it can be published<\/span><\/h3>\n<ol>\n<li><span style=\"font-size: small\">On the standard toolbar, change the configuration to Release.&nbsp;<br \/><\/span><a href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx\/$Release[2].png\"><\/a><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/7142.Release.bmp\" border=\"0\" \/> <\/li>\n<li><span style=\"font-size: small\">Rebuild the application by selecting Build &gt; Rebuild. The XAP file of the application is generated, which is the package you will have to submit to the marketplace in order to publish the application. You can also locate this XAP file in the BinRelease folder. <br \/><\/span><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2011\/02\/0160.XAP_.bmp\" width=\"566\" border=\"0\" height=\"239\" \/><a href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx\/$XAP[2].png\"><\/a><\/li>\n<\/ol>\n<p><span style=\"font-size: small\">&nbsp;To submit your application to the market place, you can refer to <\/span><a href=\"http:\/\/create.msdn.com\/en-US\/home\/about\/app_submission_walkthrough_upload\"><span style=\"font-size: small\">upload your application walkthrough<\/span><\/a><span style=\"font-size: small\">.<\/span><\/p>\n<h3><b>Summary<\/b><\/h3>\n<p><span style=\"font-size: small\">That&rsquo;s it! You have now successfully created your first Windows Phone 7 Silverlight application, that too in just 3 simple steps! You can find the full source code for the Visual Basic Mini Browser application <\/span><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ff431744(v=VS.92).aspx\"><span style=\"font-size: small\">here<\/span><\/a><span style=\"font-size: small\">. This application uses general Silverlight and Visual Basic features. <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have experienced a lot of fun writing Windows Phone 7 applications in Visual Basic. Web browser is one of the applications that is commonly used on phones these days. In this blog post, I want to share some sample source code that will help you to create a mini browser application for Windows Phone [&hellip;]<\/p>\n","protected":false},"author":260,"featured_media":8818,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[195],"tags":[137,167,180],"class_list":["post-713","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-basic","tag-silverlight","tag-vb2010","tag-windows-phone"],"acf":[],"blog_post_summary":"<p>I have experienced a lot of fun writing Windows Phone 7 applications in Visual Basic. Web browser is one of the applications that is commonly used on phones these days. In this blog post, I want to share some sample source code that will help you to create a mini browser application for Windows Phone [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts\/713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/users\/260"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/comments?post=713"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts\/713\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/media\/8818"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/media?parent=713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/categories?post=713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/tags?post=713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}