<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>uprush &#187; browser</title>
	<atom:link href="http://uprush.net/tag/browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://uprush.net</link>
	<description>YiFeng's Blog</description>
	<lastBuildDate>Wed, 03 Feb 2010 14:34:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ブラウザ風Windows Formアプリ開発</title>
		<link>http://uprush.net/2009/05/%e3%83%96%e3%83%a9%e3%82%a6%e3%82%b6%e9%a2%a8windows-form%e3%82%a2%e3%83%97%e3%83%aa%e9%96%8b%e7%99%ba/</link>
		<comments>http://uprush.net/2009/05/%e3%83%96%e3%83%a9%e3%82%a6%e3%82%b6%e9%a2%a8windows-form%e3%82%a2%e3%83%97%e3%83%aa%e9%96%8b%e7%99%ba/#comments</comments>
		<pubDate>Sat, 16 May 2009 14:33:20 +0000</pubDate>
		<dc:creator>uprush</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[form]]></category>

		<guid isPermaLink="false">http://blog.uprush.net/?p=156</guid>
		<description><![CDATA[&#160;DotNet でアプリケーションを開発する場合、画面遷移の主なパターンは二つあります。MDIフォームかDialogフォームです。業務内容によって、MDIと Dialogフォームが適当でない場合があります。ここでは、ウェブ ブラウザの画面遷移とよく似ている「Windows Form のブラウザ」アプリケーションの開発を紹介します
&#160;

画面構成

画面はメイン画面と詳細画面から成ります。※１
画面遷移時、メイン画面が常にロードされています。業務によって、詳細画面が変わります。アプリ稼動中に、メイン画面のインスタンスは一つだけあります。
※１：画面の一部だけ変わる場合、詳細画面上の任意のところで、埋め込まれるサブ画面も表示できますが、今回は割愛します。

&#160;
メイン画面の構成
ヘッダー部の左の「戻る」と「HOME」ボタンは必須ですが、右は自由です。ヘッダーの下は詳細画面を入れる Panel です（PAL_Detail）。
PAL_Detail のプロパティについて、「Dock = Fill」、「BorderStyle = Fixed3D」にします。
詳細画面の構成
詳細画面のサイズはメイン画面の PAL_Detail のサイズとあわせます。プロパティについて、「StartPosition = CenterParent」、「FormBorderStyle = None」にします。画面の内容とデザインは自由です。
&#160;

実装

メイン画面は詳細画面の遷移と画面間の通信などを管理します。PAL_Detail 内の詳細画面の切替で画面遷移を実装します。
詳細画面の表示
メイン画面は表示する詳細画面の参照を引き取って、詳細画面を PAL_Detail に入れます。
FormMain.vb  

Protected&#160;Friend&#160;Sub&#160;ShowDetail(ByRef&#160;detail&#160;As&#160;FormDetail)&#160;
&#160;&#160;&#160;&#160;If&#160;detail&#160;Is&#160;Nothing&#160;Then&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Return&#160;
&#160;&#160;&#160;&#160;End&#160;If&#160;
&#160;
&#160;&#160;&#160;&#160;&#8217;メイン画面の表題&#160;
&#160;&#160;&#160;&#160;Me.Text&#160;=&#160;detail.Text&#160;
&#160;
&#160;&#160;&#160;&#160;&#8217;詳細画面を表示する&#160;
&#160;&#160;&#160;&#160;detail.TopLevel&#160;=&#160;False&#160;
&#160;&#160;&#160;&#160;PAL_Detail.Controls.Add(detail)&#160;
&#160;&#160;&#160;&#160;detail.BringToFront()&#160;
&#160;&#160;&#160;&#160;detail.Show()&#160;
End&#160;Sub&#160;

Protected Friend Sub ShowDetail(ByRef detail As FormDetail)     If detail Is Nothing Then         Return     End If  [...]]]></description>
		<wfw:commentRss>http://uprush.net/2009/05/%e3%83%96%e3%83%a9%e3%82%a6%e3%82%b6%e9%a2%a8windows-form%e3%82%a2%e3%83%97%e3%83%aa%e9%96%8b%e7%99%ba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
