Form.Footer プロパティ
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)
構文
使用例
Footer プロパティを使用して、FooterTemplate の内容にアクセスする方法を次のコード例に示します。
このコード例は、ControlToPaginate プロパティのトピックで取り上げているコード例の一部です。
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
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(); } }
この例では、<Choice> 要素にフィルタが指定されていないため、常に SelectedChoice になります。フィルタを指定するには、要素を <Choice Filter="isPocketIE"> に変更し、使用するフィルタを定義している Web.config ファイルを含めます。
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- Form.Footer プロパティのページへのリンク