View イベント

名前 | 説明 | |
---|---|---|
![]() | Activate | 現在の View コントロールがアクティブ ビューになったときに発生します。 |
![]() | DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。 ( Control から継承されます。) |
![]() | Deactivate | 現在のアクティブ View コントロールがアクティブでなくなったときに発生します。 |
![]() | Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。 ( Control から継承されます。) |
![]() | Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。 ( Control から継承されます。) |
![]() | Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。 ( Control から継承されます。) |
![]() | PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。 ( Control から継承されます。) |
![]() | Unload | サーバー コントロールがメモリからアンロードされると発生します。 ( Control から継承されます。) |

関連項目
View クラスSystem.Web.UI.WebControls 名前空間
MultiView クラス
Button クラス
LinkButton クラス
その他の技術情報
MultiView Web サーバー コントロールおよび View Web サーバー コントロールView クラス
アセンブリ: System.Web (system.web.dll 内)


View コントロールは、コントロールのグループ用のコンテナです。View コントロールは、常に MultiView コントロールに格納されている必要があります。一度に 1 つの View コントロールだけを MultiView コントロール内のアクティブ ビューとして定義できます。
ActiveViewIndex プロパティは、MultiView コントロールの Views コレクション内のアクティブ View コントロールを指定します。アクティブ ビュー コントロールは、そのコントロールを格納している MultiView コントロールが表示されていれば、クライアントに表示されます。View コントロールとその子コントロールがページに表示され、クライアントに表示されているかどうかを確認するには、Visible プロパティを使用します。
View コントロールには、他の MultiView も含め、どの型のコントロールでも格納できます。View コントロールは、スタイル プロパティをサポートしていません。View コントロールにスタイルを適用するには、1 つ以上の Panel コントロールを View コントロールに追加します。
View クラスには、Activate イベントと Deactivate イベントが用意されています。Activate イベントは、View コントロールがアクティブ ビューになったときに発生します。このイベントは、ActiveViewIndex プロパティの値が変更されるか、SetActiveView メソッドが呼び出されて、別の View コントロールが指定されたときに発生します。たとえば、View1 が MultiView コントロール内のアクティブ ビューである場合に、ActiveViewIndex プロパティが変更されて View2 が指定されると、View2 に対して Activate イベントが発生し、View1 に対して Deactivate イベントが発生します。
MultiView コントロール内の複数の View コントロール間をユーザーが移動できるようにするには、LinkButton コントロールまたは Button コントロールを各 View コントロールに追加します。LinkButton コントロールまたは Button コントロールの CommandName プロパティを、移動先の View コントロールの ID に設定します。コード例については、「ActiveViewChanged」を参照してください。
MultiView コントロール内の View コントロールを操作する方法の詳細については、MultiView のトピックを参照してください。
Topic | Location |
---|---|
方法 : Web フォーム ページに MultiView Web サーバー コントロールを追加する | ASP .NET Web アプリケーションの作成 |
方法 : Web フォーム ページに MultiView Web サーバー コントロールを追加する (Visual Studio) | Visual Studio での ASP .NET Web アプリケーションの作成 |

3 つの View コントロールを格納している MultiView コントロールを作成する方法のコード例を次に示します。ページが初めて読み込まれたときに、DefaultView がアクティブ ビューとして設定されます。各 View コントロールには、ユーザーが別のビューに移動できるようにするためのリンク ボタンが格納されています。各 View コントロールには、スタイルを適用できるようにするための Panel コントロールが格納されています。
<%@ Page Language="VB" %> <html> <head> <script runat="server"> Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) ' The first time the page loads, ' render the DefaultView. If Not IsPostBack Then ' Set DefaultView as the active view. MultiView1.SetActiveView(DefaultView) End If End Sub Sub LinkButton_Command(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs) ' Determine which link button was clicked ' and set the active view to ' the view selected by the user. Select Case (e.CommandArgument) Case "DefaultView" MultiView1.SetActiveView(DefaultView) Case "News" MultiView1.SetActiveView(NewsView) Case "Shopping" MultiView1.SetActiveView(ShoppingView) Case Else Throw New Exception("You did not select a valid list item.") End Select End Sub </script> </html> <body> <form ID="Form1" runat="server"> <h3>MultiView Class Example</h3> <asp:MultiView id="MultiView1" runat="Server"> <asp:View id="DefaultView" runat="Server"> <asp:Panel id="DefaultViewPanel" Width="330px" BackColor="#C0C0FF" BorderColor="#404040" BorderStyle="Double" runat="Server"> <asp:Label id="DefaultLabel1" Font-bold="true" Font-size="14" Text="The Default View" runat="Server"> </asp:Label> <asp:BulletedList id="DefaultBulletedList1" BulletStyle="Disc" DisplayMode="Hyperlink" Target="_blank" runat="Server"> <asp:ListItem Value="http://www.microsoft.com">Today's Weather</asp:ListItem> <asp:ListItem Value="http://www.microsoft.com">Today's Stock Quotes</asp:ListItem> <asp:ListItem Value="http://www.microsoft.com">Today's News Headlines</asp:ListItem> <asp:ListItem Value="http://www.microsoft.com">Today's Featured Shopping</asp:ListItem> </asp:BulletedList> <hr> <asp:Label id="DefaultLabel2" Font-size="12" Text="Click a link to display a different view:" runat="Server"> </asp:Label><br> <asp:LinkButton id="Default_NewsLink" Text="Go to News View" OnCommand="LinkButton_Command" CommandArgument="News" CommandName="Link" Width="150px" runat="Server"> </asp:LinkButton> <asp:LinkButton id="Default_ShoppingLink" Text="Go to Shopping View" OnCommand="LinkButton_Command" CommandArgument="Shopping" CommandName="Link" Width="150px" runat="server"> </asp:LinkButton><br><br> </asp:Panel> </asp:View> <asp:View id="NewsView" runat="Server"> <asp:Panel id="NewsPanel1" Width="330px" BackColor="#C0FFC0" BorderColor="#404040" BorderStyle="Double" runat="Server"> <asp:Label id="NewsLabel1" Font-bold="true" Font-size="14" Text="The News View" runat="Server"> </asp:Label> <asp:BulletedList id="NewsBulletedlist1" BulletStyle="Disc" DisplayMode="Hyperlink" Target="_blank" runat="Server"> <asp:ListItem Value="http://www.microsoft.com">Today's International Headlines</asp:ListItem> <asp:ListItem Value="http://www.microsoft.com">Today's National Headlines</asp:ListItem> <asp:ListItem Value="http://www.microsoft.com">Today's Local News</asp:ListItem> </asp:BulletedList> <hr> <asp:Label id="NewsLabel2" Font-size="12" Text="Click a link to display a different view:" runat="Server"> </asp:Label><br> <asp:LinkButton id="News_DefaultLink" Text="Go to the Default View" OnCommand="LinkButton_Command" CommandArgument="DefaultView" CommandName="Link" Width="150px" runat="Server"> </asp:LinkButton> <asp:LinkButton id="News_ShoppingLink" Text="Go to Shopping View" OnCommand="LinkButton_Command" CommandArgument="Shopping" CommandName="Link" Width="150px" runat="Server"> </asp:LinkButton><br><br> </asp:Panel> </asp:View> <asp:View id="ShoppingView" runat="Server"> <asp:Panel id="ShoppingPanel1" Width="330px" BackColor="#FFFFC0" BorderColor="#404040" BorderStyle="Double" runat="Server"> <asp:Label id="ShoppingLabel1" Font-Bold="true" Font-size="14" Text="The Shopping View" runat="Server"> </asp:Label> <asp:BulletedList id="ShoppingBulletedlist1" BulletStyle="Disc" DisplayMode="Hyperlink" Target="_blank" runat="Server"> <asp:ListItem Value="http://www.microsoft.com">Shop for Home and Garden </asp:ListItem> <asp:ListItem Value="http://www.microsoft.com">Shop for Women's Fashions</asp:ListItem> <asp:ListItem Value="http://www.microsoft.com">Shop for Men's Fashions</asp:ListItem> </asp:BulletedList> <hr> <asp:Label id="ShoppingLabel2" Font-size="12" Text="Click a link to display a different view:" runat="Server"> </asp:Label><br> <asp:LinkButton id="Shopping_DefaultLink" Text="Go to the Default View" OnCommand="LinkButton_Command" CommandArgument="DefaultView" CommandName="Link" Width="150px" runat="Server"> </asp:LinkButton> <asp:LinkButton id="Shopping_NewsLink" Text="Go to News View" OnCommand="LinkButton_Command" CommandArgument="News" CommandName="Link" Width="150px" runat="Server"> </asp:LinkButton><br><br> </asp:Panel> </asp:View> </asp:MultiView> </form> </body> </html>


System.Web.UI.Control
System.Web.UI.WebControls.View
System.Web.UI.WebControls.WizardStepBase


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


View コンストラクタ
アセンブリ: System.Web (system.web.dll 内)


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


View プロパティ



関連項目
View クラスSystem.Web.UI.WebControls 名前空間
MultiView クラス
Button クラス
LinkButton クラス
その他の技術情報
MultiView Web サーバー コントロールおよび View Web サーバー コントロールView メソッド



関連項目
View クラスSystem.Web.UI.WebControls 名前空間
MultiView クラス
Button クラス
LinkButton クラス
その他の技術情報
MultiView Web サーバー コントロールおよび View Web サーバー コントロールView 列挙体
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Enumeration View

メンバ名 | 説明 | |
---|---|---|
![]() | Details | 各項目は各行に表示され、各項目に関する詳しい情報が各列に配置されます。左端の列には小さいアイコンとラベルが示されます。次の列にはアプリケーションで指定されたサブ項目が示されます。列には、列のキャプションを示すヘッダーが表示されます。ユーザーは実行時に各列のサイズを変更できます。 |
![]() | LargeIcon | 各項目は、ラベルが下に付いているフルサイズのアイコンとして表示されます。 |
![]() | List | 各項目は、ラベルが右側に付いている小さいアイコンとして表示されます。項目は、列ヘッダーのない列に配置されます。 |
![]() | SmallIcon | 各項目は、ラベルが右側に付いている小さいアイコンとして表示されます。 |
Tile | 各項目はフルサイズのアイコンとして表示され、右側にラベルとサブ項目の情報が表示されます。表示するサブ項目の情報は、アプリケーションによって指定されます。この情報は Windows XP および Windows Server 2003 ファミリでのみ表示されます。古いオペレーティング システムではこの値が無視され、LargeIcon ビューには ListView コントロールが表示されます。 |


ListView.View プロパティをいずれかの View 列挙値に設定するコード例を次に示します。この例を実行するには、次のコードをフォームに貼り付けて、フォームのコンストラクタまたは Load メソッドで InitializeListView メソッドを呼び出します。
' Declare the Listview object. Friend WithEvents myListView As System.Windows.Forms.ListView ' Initialize the ListView object with subitems of a different ' style than the default styles for the ListView. Private Sub InitializeListView() ' Set the Location, View and Width properties for the ' ListView object. myListView = New ListView With (myListView) .Location = New System.Drawing.Point(20, 20) ' The View property must be set to Details for the ' subitems to be visible. .View = View.Details .Width = 250 End With ' Each SubItem object requires a column, so add three columns. Me.myListView.Columns.Add("Key", 50, HorizontalAlignment.Left) Me.myListView.Columns.Add("A", 100, HorizontalAlignment.Left) Me.myListView.Columns.Add("B", 100, HorizontalAlignment.Left) ' Add a ListItem object to the ListView. Dim entryListItem As ListViewItem = myListView.Items.Add("Items") ' Set UseItemStyleForSubItems property to false to change ' look of subitems. entryListItem.UseItemStyleForSubItems = False ' Add the expense subitem. Dim expenseItem As ListViewItem.ListViewSubItem = _ entryListItem.SubItems.Add("Expense") ' Change the expenseItem object's color and font. expenseItem.ForeColor = System.Drawing.Color.Red expenseItem.Font = New System.Drawing.Font _ ("Arial", 10, System.Drawing.FontStyle.Italic) ' Add a subitem called revenueItem Dim revenueItem As ListViewItem.ListViewSubItem = _ entryListItem.SubItems.Add("Revenue") ' Change the revenueItem object's color and font. revenueItem.ForeColor = System.Drawing.Color.Blue revenueItem.Font = New System.Drawing.Font _ ("Times New Roman", 10, System.Drawing.FontStyle.Bold) ' Add the ListView to the form. Me.Controls.Add(Me.myListView) End Sub
// Declare the Listview object. internal System.Windows.Forms.ListView myListView; // Initialize the ListView object with subitems of a different // style than the default styles for the ListView. private void InitializeListView() { // Set the Location, View and Width properties for the // ListView object. myListView = new ListView(); myListView.Location = new System.Drawing.Point(20, 20); myListView.Width = 250; // The View property must be set to Details for the // subitems to be visible. myListView.View = View.Details; // Each SubItem object requires a column, so add three columns. this.myListView.Columns.Add("Key", 50, HorizontalAlignment.Left); this.myListView.Columns.Add("A", 100, HorizontalAlignment.Left); this.myListView.Columns.Add("B", 100, HorizontalAlignment.Left); // Add a ListItem object to the ListView. ListViewItem entryListItem = myListView.Items.Add("Items"); // Set UseItemStyleForSubItems property to false to change // look of subitems. entryListItem.UseItemStyleForSubItems = false; // Add the expense subitem. ListViewItem.ListViewSubItem expenseItem = entryListItem.SubItems.Add("Expense"); // Change the expenseItem object's color and font. expenseItem.ForeColor = System.Drawing.Color.Red; expenseItem.Font = new System.Drawing.Font( "Arial", 10, System.Drawing.FontStyle.Italic); // Add a subitem called revenueItem ListViewItem.ListViewSubItem revenueItem = entryListItem.SubItems.Add("Revenue"); // Change the revenueItem object's color and font. revenueItem.ForeColor = System.Drawing.Color.Blue; revenueItem.Font = new System.Drawing.Font( "Times New Roman", 10, System.Drawing.FontStyle.Bold); // Add the ListView to the form. this.Controls.Add(this.myListView); }
internal: // Declare the Listview object. System::Windows::Forms::ListView^ myListView; private: // Initialize the ListView object with subitems of a different // style than the default styles for the ListView. void InitializeListView() { // Set the Location, View and Width properties for the // ListView object. myListView = gcnew ListView; myListView->Location = System::Drawing::Point( 20, 20 ); myListView->Width = 250; // The View property must be set to Details for the // subitems to be visible. myListView->View = View::Details; // Each SubItem object requires a column, so add three columns. this->myListView->Columns->Add( "Key", 50, HorizontalAlignment::Left ); this->myListView->Columns->Add( "A", 100, HorizontalAlignment::Left ); this->myListView->Columns->Add( "B", 100, HorizontalAlignment::Left ); // Add a ListItem object to the ListView. ListViewItem^ entryListItem = myListView->Items->Add( "Items" ); // Set UseItemStyleForSubItems property to false to change // look of subitems. entryListItem->UseItemStyleForSubItems = false; // Add the expense subitem. ListViewItem::ListViewSubItem ^ expenseItem = entryListItem->SubItems->Add( "Expense" ); // Change the expenseItem object's color and font. expenseItem->ForeColor = System::Drawing::Color::Red; expenseItem->Font = gcnew System::Drawing::Font( "Arial",10,System::Drawing::FontStyle::Italic ); // Add a subitem called revenueItem ListViewItem::ListViewSubItem ^ revenueItem = entryListItem->SubItems->Add( "Revenue" ); // Change the revenueItem object's color and font. revenueItem->ForeColor = System::Drawing::Color::Blue; revenueItem->Font = gcnew System::Drawing::Font( "Times New Roman",10,System::Drawing::FontStyle::Bold ); // Add the ListView to the form. this->Controls->Add( this->myListView ); }
// Declare the Listview object. System.Windows.Forms.ListView myListView; // Initialize the ListView object with subitems of a different // style than the default styles for the ListView. private void InitializeListView() { // Set the Location, View and Width properties for the // ListView object. myListView = new ListView(); myListView.set_Location(new System.Drawing.Point(20, 20)); myListView.set_Width(250); // The View property must be set to Details for the // subitems to be visible. myListView.set_View(View.Details); // Each SubItem object requires a column, so add three columns. this.myListView.get_Columns().Add("Key", 50, HorizontalAlignment.Left); this.myListView.get_Columns().Add("A", 100, HorizontalAlignment.Left); this.myListView.get_Columns().Add("B", 100, HorizontalAlignment.Left); // Add a ListItem object to the ListView. ListViewItem entryListItem = myListView.get_Items().Add("Items"); // Set UseItemStyleForSubItems property to false to change // look of subitems. entryListItem.set_UseItemStyleForSubItems(false); // Add the expense subitem. ListViewItem.ListViewSubItem expenseItem = entryListItem.get_SubItems().Add("Expense"); // Change the expenseItem object's color and font. expenseItem.set_ForeColor(System.Drawing.Color.get_Red()); expenseItem.set_Font(new System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Italic)); // Add a subitem called revenueItem ListViewItem.ListViewSubItem revenueItem = entryListItem.get_SubItems().Add("Revenue"); // Change the revenueItem object's color and font. revenueItem.set_ForeColor(System.Drawing.Color.get_Blue()); revenueItem.set_Font(new System.Drawing.Font("Times New Roman", 10, System.Drawing.FontStyle.Bold)); // Add the ListView to the form. this.get_Controls().Add(this.myListView); } //InitializeListView

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


Weblioに収録されているすべての辞書からviewを検索する場合は、下記のリンクをクリックしてください。

- viewのページへのリンク