New to compact framework tutorials? Learn to write your first compact framework application here.
Zac Efron - Hairspray star and Mythbusters' Kari Byron at Celebrity Treat. Check out income and career information in Singapore.

Tuesday, November 22, 2005

- Controls_: browser in your app

After writing your first app using the Microsoft .NET Compact Framework 2.0 and deploying to a Windows Mobile 5.0 Pocket PC emulator (and tips on using the Windows Mobile emulators), you are now ready to write your second app.

One of the new conrols in netcf2 is the browser control. The example here shows you how to create a simple browser app for your Pocket PC.
  1. First, start Visual Studio .NET 2005.
  2. If you're using an emulator, ensure that it is connected to the network. There are 2 methods to do this. Click Tools-> Device Emulator Manager to start the Device Emulator Manager, right-click on Windows Mobile 5.0 Pocket PC Phone Emulator (or another WM5 emulator) and click Connect. The emulator will start up. Now, in the Device Emulator Manager again, right-click on the same item and click Cradle (see pic). This will connect the emulated PDA to your PC via ActiveSync. If it is the first time you're doing this, just go through the wizard on what to synchronize (I'd uncheck everything). Your emulator should now be connected to the network via your PC. The second method is to bind the network adaptor in the emulator to the networking in your PC. In the emulator program, click File-> Configure, under the Network tab, check the first checkbox to enable the network adapter.
  3. Do a quick check by opening Internet Explorer in the emulator and browsing to a website such as www.google.com (yes, there's already a browser, so why are we writing another browser?!)
  4. Next, as in previous examples, create a Windows Mobile 5.0 Device Application project. As usual, change the Minimize Box property of the form to False.
  5. From the toolbox, drag the WebBrowser control to the form. By default, the WebBrowser control is docked to the form. This means that it fills up the entire form all the time, regardless of the form's orientation (portrait or landscape). This is a nice behavior, but we'll anchor the control instead. To do this, we first undock the control: with the control selected, you should see a little triangle. Click on it to open a "Smart Task menu", and select Undock in parent container.
  6. Still with the WebBrowser control selected, go to the Properties panel (shortcut key: F4) and change its Anchor property such that the control is anchored Bottom, Left, Right to the form (see pic below). With anchoring, the control will always maintain the same distance from the sides of the form to which it is anchored (bottom, left & right in our case here).
  7. Drag and resize the WebBrowser control such that it fills about two-thirds of the form, leaving a gap at the top. Right-click on the form (or on the little lock symbol) and select Rotate Right. You now see the landscape mode at design time! Notice that the WebBrowser control still maintains the same distance from bottom, left & right (if it fills up the form, you should decrease the height of the control). Rotate Left the form to revert to portrait mode.
  8. Drag a TextBox control and a Button control to the form. Change the Text property of each to have this:
  9. Finally, double-click on the Go! button and add this line of code to its click event handler:
  10. Uri u = new Uri(textBox1.Text); webBrowser1.Navigate(u);
  11. Click Ctrl-F5 to run. Enter a valid URL and click Go!. To see the anchoring in action, click on the calendar button in the emulator (circled in red in pic below) to change to landscape orientation.
Where do we go from here? Let's write something more complicated, like a Sudoku solver! And maybe check out the Dell Axim X51v.

Categories: [Controls_] Tags: [] [] []

7 Comments:

Anonymous Anonymous said...

How does one disable the context menu? I set webbrowser1.ContextMenu = null but with no success.

2/24/2006  
Anonymous Anonymous said...

I am looking into disabling the context menu too. Any solution?

5/02/2006  
Anonymous Anonymous said...

There seem to be lots of issues with the WebBrowser on .NETCF

For example, try dropping it onto a Panel or TabControl, suddenly no links work!

Apparently the context menu is a known issue, and it works on devices running WCE 5.0 AKU2 (like service pack 2).

However, that leaves folks like me and you out in the cold, unless our device vendors relase a ROM update.
(Couldn't find one for my AXIM or IPAQ).

Let me know if you find any new info :)

5/09/2006  
Anonymous Anonymous said...

I do not have a WebBrowser control in my toolbox. What do I need to do to be able to see this control? Sorry for the newbie question.

5/12/2006  
Blogger sexy said...

情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣,情趣,情趣,情趣,情趣,情趣,情趣,情趣,按摩棒,跳蛋,充氣娃娃,情境坊歡愉用品,情趣用品,情人節禮物,情惑用品性易購,A片,視訊聊天室,色情聊天室,聊天室

免費A片,AV女優,美女視訊,情色交友,免費AV,色情網站,辣妹視訊,美女交友,色情影片,成人影片,成人網站,A片,H漫,18成人,成人圖片,成人漫畫,情色網,日本A片,免費A片下載,性愛

A片,色情,成人,做愛,情色文學,A片下載,色情遊戲,色情影片,色情聊天室,情色電影,免費視訊,免費視訊聊天,免費視訊聊天室,一葉情貼圖片區,情色,情色視訊,免費成人影片,視訊交友,視訊聊天,視訊聊天室,言情小說,愛情小說,AIO,AV片,A漫,avdvd,聊天室,自拍,情色論壇,視訊美女,AV成人網,色情A片,SEX,成人論壇

情趣用品,A片,免費A片,AV女優,美女視訊,情色交友,色情網站,免費AV,辣妹視訊,美女交友,色情影片,成人網站,H漫,18成人,成人圖片,成人漫畫,成人影片,情色網


情趣用品,A片,免費A片,日本A片,A片下載,線上A片,成人電影,嘟嘟成人網,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,微風成人區,成人文章,成人影城,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,臺灣情色網,色情,情色電影,色情遊戲,嘟嘟情人色網,麗的色遊戲,情色論壇,色情網站,一葉情貼圖片區,做愛,性愛,美女視訊,辣妹視訊,視訊聊天室,視訊交友網,免費視訊聊天,美女交友,做愛影片

av,情趣用品,a片,成人電影,微風成人,嘟嘟成人網,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,成人文章,成人影城,愛情公寓,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,色情,寄情築園小遊戲,情色電影,aio,av女優,AV,免費A片,日本a片,美女視訊,辣妹視訊,聊天室,美女交友,成人光碟

情趣用品.A片,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,色情,寄情築園小遊戲,情色電影,色情遊戲,色情網站,聊天室,ut聊天室,豆豆聊天室,美女視訊,辣妹視訊,視訊聊天室,視訊交友網,免費視訊聊天,免費A片,日本a片,a片下載,線上a片,av女優,av,成人電影,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,成人文章,成人影城,成人網站,自拍,尋夢園聊天室

12/22/2008  
Blogger  said...

A片,A片,成人網站,成人漫畫,色情,情色網,情色,AV,AV女優,成人影城,成人,色情A片,日本AV,免費成人影片,成人影片,SEX,免費A片,A片下載,免費A片下載,做愛,情色A片,色情影片,H漫,A漫,18成人

a片,色情影片,情色電影,a片,色情,情色網,情色,av,av女優,成人影城,成人,色情a片,日本av,免費成人影片,成人影片,情色a片,sex,免費a片,a片下載,免費a片下載

情趣用品,情趣用品,情趣,情趣,情趣用品,情趣用品,情趣,情趣,情趣用品,情趣用品,情趣,情趣

A片,A片,A片下載,做愛,成人電影,.18成人,日本A片,情色小說,情色電影,成人影城,自拍,情色論壇,成人論壇,情色貼圖,情色,免費A片,成人,成人網站,成人圖片,AV女優,成人光碟,色情,色情影片,免費A片下載,SEX,AV,色情網站,本土自拍,性愛,成人影片,情色文學,成人文章,成人圖片區,成人貼圖

視訊聊天室,辣妹視訊,視訊辣妹,情色視訊,視訊,080視訊聊天室,視訊交友90739,美女視訊,視訊美女,免費視訊聊天室,免費視訊聊天,免費視訊,視訊聊天室,視訊聊天,視訊交友網,視訊交友,情人視訊網,成人視訊,哈啦聊天室,UT聊天室,豆豆聊天室,
聊天室,聊天,色情聊天室,色情,尋夢園聊天室,聊天室尋夢園,080聊天室,080苗栗人聊天室,柔情聊天網,小高聊天室,上班族聊天室,080中部人聊天室,中部人聊天室,成人聊天室,成人,一夜情聊天室,一夜情,情色聊天室,情色,美女交友

1/18/2009  
Anonymous Anonymous said...

^^ nice blog!! ^@^

徵信, 徵信, 徵信, 徵信社, 徵信社, 徵信社, 感情挽回, 婚姻挽回, 挽回婚姻, 挽回感情, 徵信, 徵信社, 徵信, 徵信, 捉姦, 徵信公司, 通姦, 通姦罪, 抓姦, 抓猴, 捉猴, 捉姦, 監聽, 調查跟蹤, 反跟蹤, 外遇問題, 徵信, 捉姦, 女人徵信, 外遇問題, 女子徵信, 徵信社, 外遇, 徵信公司, 徵信網, 徵信, 徵信社, 外遇蒐證, 抓姦, 抓猴, 捉猴, 調查跟蹤, 反跟蹤, 感情挽回, 挽回感情, 婚姻挽回, 挽回婚姻, 感情挽回, 外遇沖開, 徵信, 徵信, 徵信社, 抓姦, 徵信, 徵信社, 外遇蒐證, 外遇, 通姦, 通姦罪, 贍養費, 徵信, 徵信社, 徵信社, 抓姦, 徵信社, 徵信社, 徵信, 徵信, 徵信公司, 徵信社, 徵信, 徵信公司, 徵信社, 徵信社, 徵信社, 徵信社, 徵信社, 徵信公司, 徵信社, 徵信, 徵信, 徵信公司, 女人徵信, 外遇, 外遇, 外遇, 外遇

徵信, 徵信網, 徵信社, 徵信網, 徵信, 徵信社, 外遇, 徵信, 徵信, 徵信社, 抓姦, 徵信, 徵信社, 外遇, 徵信社, 抓姦, 徵信社, 徵信公司, 徵信, 徵信社, 徵信公司, 徵信, 徵信社, 徵信公司, 徵信社, 徵信社, 徵信社, 徵信社, 徵信, 徵信社, 徵信社, 徵信社, 徵信

2/24/2009  

Post a Comment

Links to this post:

Create a Link Permalink

<< Home