My boss wants me to write a C# app, designed to run on a mobile device, that will prompt the user for a part number, and then use that number to display content from a web page. For example, if the user enters "441305", he wants the app to display the xml that this page generates:
http://www/scripts/justin-dev.wsc/xml_test.p?part=441305. The catch is that he doesn't want the program to open a browser window, he wants the results displayed inside a large window at the bottom of the app (nothing but horizontal and vertical scrollbars). So, my question to you is how do i get this page to display inside of the form?
My code thus far is as follows:
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
namespace MobileApp
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextB
ox SearchBox;
private System.Windows.Forms.Label
SearchLabel;
private System.Windows.Forms.Butto
n SearchButton;
private System.Windows.Forms.Label
CopyrightLabel;
private System.Windows.Forms.Label
label1;
private System.Windows.Forms.MainM
enu mainMenu1;
private System.Windows.Forms.MenuI
tem menuItem1;
private System.Windows.Forms.TextB
ox ResultsBox;
private System.Windows.Forms.MenuI
tem menuItem3;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceM
anager resources = new System.Resources.ResourceM
anager(typ
eof(Form1)
);
this.mainMenu1 = new System.Windows.Forms.MainM
enu();
this.menuItem1 = new System.Windows.Forms.MenuI
tem();
this.menuItem3 = new System.Windows.Forms.MenuI
tem();
this.SearchLabel = new System.Windows.Forms.Label
();
this.SearchBox = new System.Windows.Forms.TextB
ox();
this.SearchButton = new System.Windows.Forms.Butto
n();
this.CopyrightLabel = new System.Windows.Forms.Label
();
this.label1 = new System.Windows.Forms.Label
();
this.ResultsBox = new System.Windows.Forms.TextB
ox();
//
// mainMenu1
//
this.mainMenu1.MenuItems.A
dd(this.me
nuItem1);
//
// menuItem1
//
this.menuItem1.MenuItems.A
dd(this.me
nuItem3);
this.menuItem1.Text = "File";
this.menuItem1.Click += new System.EventHandler(this.m
enuItem1_C
lick);
//
// menuItem3
//
this.menuItem3.Text = "Exit";
this.menuItem3.Click += new System.EventHandler(this.m
enuItem3_C
lick);
//
// SearchLabel
//
this.SearchLabel.Location = new System.Drawing.Point(45, 32);
this.SearchLabel.Size = new System.Drawing.Size(104, 24);
this.SearchLabel.Text = "Search String:";
this.SearchLabel.TextAlign
= System.Drawing.ContentAlig
nment.TopC
enter;
this.SearchLabel.ParentCha
nged += new System.EventHandler(this.l
abel1_Pare
ntChanged)
;
//
// SearchBox
//
this.SearchBox.Location = new System.Drawing.Point(37, 48);
this.SearchBox.Size = new System.Drawing.Size(120, 22);
this.SearchBox.Text = "";
//
// SearchButton
//
this.SearchButton.Location
= new System.Drawing.Point(61, 72);
this.SearchButton.Text = "Search";
//
// CopyrightLabel
//
this.CopyrightLabel.ForeCo
lor = System.Drawing.SystemColor
s.ControlT
ext;
this.CopyrightLabel.Locati
on = new System.Drawing.Point(25, 176);
this.CopyrightLabel.Size = new System.Drawing.Size(144, 20);
this.CopyrightLabel.Text = "(c) 2004 Justin";
this.CopyrightLabel.TextAl
ign = System.Drawing.ContentAlig
nment.TopC
enter;
this.CopyrightLabel.Parent
Changed += new System.EventHandler(this.C
opyrightLa
bel_Parent
Changed);
//
// label1
//
this.label1.Font = new System.Drawing.Font("Tahom
a", 9F, System.Drawing.FontStyle.B
old);
this.label1.Location = new System.Drawing.Point(16, 8);
this.label1.Size = new System.Drawing.Size(163, 20);
this.label1.Text = "Mobile Test Application";
this.label1.TextAlign = System.Drawing.ContentAlig
nment.TopC
enter;
//
// ResultsBox
//
this.ResultsBox.Location = new System.Drawing.Point(24, 112);
this.ResultsBox.Size = new System.Drawing.Size(152, 22);
this.ResultsBox.Text = "Results go here";
//
// Form1
//
this.ClientSize = new System.Drawing.Size(194, 199);
this.Controls.Add(this.Res
ultsBox);
this.Controls.Add(this.lab
el1);
this.Controls.Add(this.Cop
yrightLabe
l);
this.Controls.Add(this.Sea
rchButton)
;
this.Controls.Add(this.Sea
rchBox);
this.Controls.Add(this.Sea
rchLabel);
this.Font = new System.Drawing.Font("Tahom
a", 8.25F, System.Drawing.FontStyle.R
egular);
this.Icon = ((System.Drawing.Icon)(res
ources.Get
Object("$t
his.Icon")
));
this.Menu = this.mainMenu1;
this.Text = "Mobile Test App";
this.Load += new System.EventHandler(this.F
orm1_Load)
;
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
Application.Run(new Form1());
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
private void menuItem2_Click_1(object sender, System.EventArgs e)
{
Application.Run(new Form1());
}
}
}