MultiView.Views プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MultiView.Views プロパティの意味・解説 

MultiView.Views プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

MultiView コントロール内の View コントロールコレクション取得します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Overridable ReadOnly
 Property Views As ViewCollection
Dim instance As MultiView
Dim value As ViewCollection

value = instance.Views
public virtual ViewCollection Views { get;
 }
public:
virtual property ViewCollection^ Views {
    ViewCollection^ get ();
}
/** @property */
public ViewCollection get_Views ()
public function get Views
 () : ViewCollection

プロパティ
MultiView コントロール内の View コントロールコレクションを表す ViewCollection。既定値null 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

View コントロールを、プログラムによって MultiView コントロール追加する方法の例を次に示します。各 View コントロール作成され後で MultiView.Views.Add() 構文使用してView コントロールMultiView コントロールViewCollection コレクション追加します

メモメモ

次のコード サンプルはシングルファイル コード モデル使用しており、分離コード ファイル直接コピーされ場合正常に動作しない可能性あります。このコード サンプルは、拡張子.aspx の空のテキスト ファイルコピーする必要がありますWeb フォームコード モデル詳細については、「ASP.NET Web ページコード モデル」を参照してください

<%@ Page Language="VB"%>
<html>
<head> 
    <script runat="server">

        Sub Index_Changed(ByVal Sender As
 Object, ByVal e As EventArgs)
            ' A MultiView was added to the page declaratively.
            ' Now add the View control programmatically.           
 
            
            If SelectViewListBox.SelectedIndex >= 0 Then
                ' The user selected a view.
                ' Determine which view the user selected.
            
                Dim viewName As String
 = SelectViewListBox.SelectedItem.Text
                Dim myView as New
 View

                ' Use a helper function to create the view.
                myView = CreateView(viewName, "This is "
 + viewName)

                ' Add myView to the ViewCollection of the MultiView1
 control.
                MultiView1.Views.Add(myView)

                ' Set myView as the active view.
                MultiView1.SetActiveView(myView)

                ' The Panel control was initially set to not visible.
                ' Set it to visible to add styles to the myView.
                Panel1.Visible=True
          
            Else
                Throw New Exception("You
 did not select a valid view.")

            End If

        End Sub
        
        ' A function to programmatically create a View control.
        Private Function CreateView(ByVal
 viewId As String, ByVal
 viewDescription As String) As View
            ' Create a View control
            Dim myView As New
 View
            myView.ID = viewId
            
            ' Create a Label control.
            Dim Label1 As New
 Label

            ' Set the text property for the label.
            Label1.Text = viewDescription
            
            ' Add the label to the controls collection of the view.
            myView.Controls.Add(Label1)
            
            Return myView
        End Function

</script>
 
</head>
<body>

    <form ID="Form1" runat="server">

        <h3>ViewCollection Class Example</h3>

        <h4>Select a View to create and
 display in a MultiView control:</h4>
            
        <asp:ListBox ID=SelectViewListBox
            AutoPostBack="True"
            Rows="1"
            SelectionMode="Single"
            OnSelectedIndexChanged="Index_Changed"
            runat="Server">
            <asp:ListItem Value=0>View1</asp:ListItem>
            <asp:ListItem Value=1>View2</asp:ListItem>
        </asp:ListBox><br><br>
        
        <hr><br> 
        
        <asp:Panel ID="Panel1"
            Height="75px"
            Width="100px"
            Backcolor="Aqua"
            BorderStyle="Double" 
            Visible = "False"
            runat="Server"> 

            <asp:MultiView ID="MultiView1"
                runat="Server">
            </asp:MultiView>

        </asp:Panel>
    
    </form>
   
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からMultiView.Views プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からMultiView.Views プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からMultiView.Views プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「MultiView.Views プロパティ」の関連用語

MultiView.Views プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MultiView.Views プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS