วันนี้เราจะมาเขียนโปรแกรมง่ายๆ นั้นก็คือ mini webbrowser
1. สร้างโปรเจคขึ้นมาให้ ตั้งชื่อว่า Minibrowser

2. เปลี่ยนชื่อข้อความที่หัวข้อ เป็น Mini Browser

3. ลากและจัด Tool ต่างดังภาพ

4. ลบข้อความ TextBox และเปลี่ยน ชื่อ Button เป็น go

5. ไปที่หน้า Code MainPage.xaml.cs
5.1 ตั้งค่าให้สามารถดูได้ทั้งแนวตั้งแนวนอนด้วยการเพิ่มคำสั่งใน Mainpage()
SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;

5.2 ตั้งเมดตอดการทำงานปุ่ม Go เพื่อรับค่า Url และ ให้ webbrowser แสดงผล
private void GoBt_Click(object sender, RoutedEventArgs e)
{
string site;
site = textBox1.Text;
try // ถ้ามีการใส่ Potocal http
{
webBrowser1.Navigate(new Uri(site, UriKind.Absolute));
}
catch // ถ้าไม่ใส่ Potocal http
{
site = "http://" + site; // เพิ่ม Potocal
webBrowser1.Navigate(new Uri(site, UriKind.Absolute));
}
}
6. ทำให้ปุ่ม Go รู้จักเมดอตอดที่สร้างด้วยการเพิ่ม event click = "GoBt_Click" ใน tag button

7. ทดสอบรันโปรแกรม

