Form.ControlToPaginate プロパティ
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)

Dim instance As Form Dim value As Control value = instance.ControlToPaginate instance.ControlToPaginate = value
[BindableAttribute(false)] public: property Control^ ControlToPaginate { Control^ get (); void set (Control^ value); }
/** @property */ public Control get_ControlToPaginate () /** @property */ public void set_ControlToPaginate (Control value)
public function get ControlToPaginate () : Control public function set ControlToPaginate (value : Control)
フォーム上で改ページ位置の自動修正が可能なコントロール。

ControlToPaginate プロパティは、フォーム上の単一のコントロールがモバイル デバイス上の複数のビューにわたってコンテンツの改ページ位置を自動修正し、前後のビューへのナビゲーションを可能にするために使用されます。コントロールは、それを格納している Panel コントロールでその Paginate プロパティが false に設定されていても、そのコンテンツの改ページ位置を自動修正できます。

Form クラスの ControlToPaginate プロパティを使用して、改ページ位置の自動修正を行うコントロールを指定する方法のコード例を次に示します。
この例では、フォームが 2 つあるページを作成します。一方のフォームには非常に長い文字列があり、デバイスによっては、この文字列の改ページ位置を自動修正して、ユーザーが全テキストにアクセスできるようにする必要があります。改ページ位置の自動修正の動作を確認するには、改ページ位置の自動修正を処理するデバイス上でこの例を参照する必要があります。Visual Studio 2005 では、[ツール] メニューの [デバイス エミュレータ マネージャ] で選択可能なデバイス エミュレータのいずれかを使用できます。
![]() |
---|
次のコード例はシングルファイル コード モデルを使用しており、分離コード ファイルに直接コピーされた場合は正常に動作しない可能性があります。このコード例は、拡張子が .aspx の空のテキスト ファイルにコピーする必要があります。詳細については、「ASP.NET Web ページのコード モデル」を参照してください。 |
<%@ Page Language="VB" Inherits="System.Web.UI.MobileControls.MobilePage" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <%@ Import Namespace="System.Web.UI.MobileControls" %> <%@ Import Namespace="System.Drawing" %> <script runat="server"> Private Sub Form_Activate(ByVal sender As Object, _ ByVal e As EventArgs) Form1.Wrapping = Wrapping.NoWrap Dim a As String = "This is a very long string <br />" Dim b As String = "START " Dim i As Integer ' Create a long string to force pagination For i = 0 To 100 b &= a Next txtView.Text = b & " END" Form1.ControlToPaginate = txtView End Sub Private Sub Form_Paginated(ByVal sender As Object, _ ByVal e As EventArgs) ' Set the background color based on ' the number of pages If ActiveForm.PageCount > 1 Then ActiveForm.BackColor = Color.LightBlue Else ActiveForm.BackColor = Color.LightGray End If ' Check to see if the Footer template has been chosen If DevSpec.HasTemplates Then Dim lbl As System.Web.UI.MobileControls.Label ' Get the Footer panel Dim pan As System.Web.UI.MobileControls.Panel = Form1.Footer ' Get the Label from the panel lbl = CType(pan.FindControl("lblCount"), System.Web.UI.MobileControls.Label) ' Set the text in the Label lbl.Text = "Page #" + Form1.CurrentPage.ToString() End If End Sub Private Sub Page_Load(ByVal sender As Object, _ ByVal e As EventArgs) ' Set the pager text properties If Not IsPostBack Then Form1.PagerStyle.NextPageText = "Go Next >" Else ' For postback, set different text Form1.PagerStyle.NextPageText = "Go More >" Form1.PagerStyle.PreviousPageText = "< Go Prev" End If End Sub </script> <html > <body> <!-- The first Form --> <mobile:Form ID="Form1" Runat="server" Paginate="true" OnActivate="Form_Activate" OnPaginated="Form_Paginated"> <mobile:link ID="Link1" Runat="server" NavigateUrl="#Form2"> Go To Other Form </mobile:link> <mobile:Label ID="Label1" Runat="server"> Welcome to ASP.NET </mobile:Label> <mobile:textview ID="txtView" Runat="server" /> <mobile:DeviceSpecific ID="DevSpec" Runat="server"> <Choice> <FooterTemplate> <mobile:Label runat="server" id="lblCount" /> </FooterTemplate> </Choice> </mobile:DeviceSpecific> </mobile:Form> <!-- The second Form --> <mobile:Form ID="Form2" Runat="server" Paginate="true" OnPaginated="Form_Paginated"> <mobile:Label ID="message2" Runat="server"> Welcome to ASP.NET </mobile:Label> <mobile:link ID="Link2" Runat="server" NavigateUrl="#Form1">Back</mobile:link> </mobile:Form> </body> </html>
<%@ Page Language="C#" Inherits="System.Web.UI.MobileControls.MobilePage" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <%@ Import Namespace="System.Web.UI.MobileControls" %> <%@ Import Namespace="System.Drawing" %> <script Runat="server"> void Form_Activate(object sender, EventArgs e) { Form1.Wrapping = Wrapping.NoWrap; string a = "This is a very long string <br />"; string b = "START "; // Create a long string to force pagination for (int i = 0; i < 100; i++) b += a; txtView.Text = b + " END"; Form1.ControlToPaginate = txtView; } void Form_Paginated(object sender, EventArgs e) { // Set the background color based on // the number of pages if (ActiveForm.PageCount > 1) ActiveForm.BackColor = Color.LightBlue; else ActiveForm.BackColor = Color.LightGray; // Check to see if the Footer template has been chosen if (DevSpec.HasTemplates) { System.Web.UI.MobileControls.Label lbl = null; // Get the Footer panel System.Web.UI.MobileControls.Panel pan = Form1.Footer; // Get the Label from the panel lbl = (System.Web.UI.MobileControls.Label)pan.FindControl("lblCount"); // Set the text in the Label lbl.Text = "Page #" + Form1.CurrentPage.ToString(); } } void Page_Load(object sender, EventArgs e) { // Set the pager text properties if (!IsPostBack) Form1.PagerStyle.NextPageText = "Go Next >"; else { // For postback, set different text Form1.PagerStyle.NextPageText = "Go More >"; Form1.PagerStyle.PreviousPageText = "< Go Prev"; } } </script> <html > <body> <!-- The first Form --> <mobile:Form ID="Form1" Runat="server" Paginate="true" OnActivate="Form_Activate" OnPaginated="Form_Paginated"> <mobile:link ID="Link1" Runat="server" NavigateUrl="#Form2"> Go To Other Form </mobile:link> <mobile:Label ID="Label1" Runat="server"> Welcome to ASP.NET </mobile:Label> <mobile:textview ID="txtView" Runat="server" /> <mobile:DeviceSpecific ID="DevSpec" Runat="server"> <Choice> <FooterTemplate> <mobile:Label runat="server" id="lblCount" /> </FooterTemplate> </Choice> </mobile:DeviceSpecific> </mobile:Form> <!-- The second Form --> <mobile:Form ID="Form2" Runat="server" Paginate="true" OnPaginated="Form_Paginated"> <mobile:Label ID="message2" Runat="server"> Welcome to ASP.NET </mobile:Label> <mobile:link ID="Link2" Runat="server" NavigateUrl="#Form1">Back</mobile:link> </mobile:Form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からForm.ControlToPaginate プロパティを検索する場合は、下記のリンクをクリックしてください。

- Form.ControlToPaginate プロパティのページへのリンク