簡介
Windows Mobile
要使用單個布局在所有三個方向下正常工作
圖
要充分利用縱向和橫向這兩個方向
注在大多數情況下
為每個方向創建單獨的布局代碼
為這兩個方向中的每一個定義一個函數
下面的示例說明了如何更新 Visual Studio
Visual Studio
使用設計器為縱向顯示器創建布局
查看該設計器生成的代碼
創建一個名為 Portrait() 並以縱向模式定位控件的新函數
使用該設計器以橫向模式所需的布局重新定位控件
使用該設計器為橫向模式生成的定位代碼來重復執行步驟
protected void Portrait() { thiscrawlTime Location = new System Drawing Point( ); this crawlTime Size = new System Drawing Size( ); this crawlTimeLabel Location = new System Drawing Point( ); this crawlTimeLabel Size = new System Drawing Size( ); this crawlStartTime Location = new System Drawing Point( ); this crawlStartTime Size = new System Drawing Size( ); this crawlStartedLabel Location = new System Drawing Point( ); this crawlStartedLabel Size = new System Drawing Size( ); this light Location = new System Drawing Point( ); this light Size = new System Drawing Size( ); this light Location = new System Drawing Point( ); this light Size = new System Drawing Size( ); this linkCount Location = new System Drawing Point( ); this linkCount Size = new System Drawing Size( ); this linkCountLabel Location = new System Drawing Point( ); this linkCountLabel Size = new System Drawing Size( ); this currentPageBox Location = new System Drawing Point( ); this currentPageBox Size = new System Drawing Size( ); this currentPageLabel Location = new System Drawing Point( ); this currentPageLabel Size = new System Drawing Size( ); this addressLabel Location = new System Drawing Point( ); this addressLabel Size = new System Drawing Size( ); this noProxyCheck Location = new System Drawing Point( ); this noProxyCheck Size = new System Drawing Size( ); this startButton Location = new System Drawing Point( ); this startButton Size = new System Drawing Size( ); this addressBox Location = new System Drawing Point( ); this addressBox Size = new System Drawing Size( ); } protected void Landscape() { this crawlTime Location = new System Drawing Point( ); this crawlTime Size = new System Drawing Size( ); this crawlTimeLabel Location = new System Drawing Point( ); this crawlTimeLabel Size = new System Drawing Size( ); this crawlStartTime Location = new System Drawing Point( ); this crawlStartTime Size = new System Drawing Size( ); this crawlStartedLabel Location = new System Drawing Point( ); this crawlStartedLabel Size = new System Drawing Size( ); this light Location = new System Drawing Point( ); this light Size = new System Drawing Size( ); this light Location = new System Drawing Point( ); this light Size = new System Drawing Size( ); this linkCount Location = new System Drawing Point( ); this linkCount Size = new System Drawing Size( ); this linkCountLabel Location = new System Drawing Point( ); this linkCountLabel Size = new System Drawing Size( ); this currentPageBox Location = new System Drawing Point( ); this currentPageBox Size = new System Drawing Size( ); this currentPageLabel Location = new System Drawing Point( ); this currentPageLabel Size = new System Drawing Size( ); this addressLabel Location = new System Drawing Point( ); this addressLabel Size = new System Drawing Size( ); this noProxyCheck Location = new System Drawing Point( ); this noProxyCheck Size = new System Drawing Size( ); this startButton Location = new System Drawing Point( ); this startButton Size = new System Drawing Size( ); this addressBox Location = new System Drawing Point( ); this addressBox Size = new System Drawing Size( ); } [
] [ ]
From:http://tw.wingwit.com/Article/program/net/201311/15398.html