TextBox.AutoCompleteType プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As TextBox Dim value As AutoCompleteType value = instance.AutoCompleteType instance.AutoCompleteType = value
[ThemeableAttribute(false)] public: virtual property AutoCompleteType AutoCompleteType { AutoCompleteType get (); void set (AutoCompleteType value); }
/** @property */ public AutoCompleteType get_AutoCompleteType () /** @property */ public void set_AutoCompleteType (AutoCompleteType value)
public function get AutoCompleteType () : AutoCompleteType public function set AutoCompleteType (value : AutoCompleteType)
TextBox コントロールのオートコンプリート動作を示す System.Web.UI.WebControls.AutoCompleteType 列挙値の 1 つ。既定値は None です。

データ入力を支援するために、Microsoft Internet Explorer 5 以降および Netscape ではオートコンプリートという機能をサポートしています。オートコンプリートは、テキスト ボックスを監視し、ユーザーが入力した値のリストを作成します。ユーザーが後でテキスト ボックスに戻ると、そのリストが表示されます。ユーザーは、前に入力した値を再入力する代わりに、このリストから値を選択するだけで済みます。TextBox コントロールのオートコンプリート機能の動作を制御するには、AutoCompleteType プロパティを使用します。AutoCompleteType プロパティに適用できる値を表すには、System.Web.UI.WebControls.AutoCompleteType 列挙体が使用されます。
![]() |
---|
既定では、TextBox コントロールの AutoCompleteType プロパティは AutoCompleteType.None に設定されています。この設定では、TextBox コントロールはさまざまなページで同じ ID プロパティを持つ他の TextBox コントロールとリストを共有します。ID プロパティの代わりにカテゴリに基づいて TextBox コントロール間でリストを共有することもできます。AutoCompleteType プロパティをいずれかのカテゴリ値 (AutoCompleteType.FirstName、AutoCompleteType.LastName など) に設定すると、同じカテゴリ値を持つすべての TextBox コントロールが同じリストを共有します。TextBox コントロールのオートコンプリート機能を無効にするには、AutoCompleteType プロパティを AutoCompleteType.Disabled に設定します。
オートコンプリート機能の設定と有効化の詳細については、ブラウザのドキュメントを参照してください。たとえば、Internet Explorer Version 5 以降でオートコンプリート機能を有効にするには、[ツール] メニューの [インターネット オプション] をクリックし、[コンテンツ] タブをクリックします。[オートコンプリート] ボタンをクリックして、オートコンプリート機能のさまざまなブラウザ オプションを表示して変更します。
Internet Explorer のオートコンプリート機能の詳細については、MSDN ライブラリ の「Using AutoComplete in HTML Forms」を参照してください。
このプロパティをテーマ別またはスタイル シート テーマ別に設定することはできません。詳細については、ThemeableAttribute、ASP.NET のテーマとスキンの概要 の各トピックを参照してください。

AutoCompleteType 列挙体を使用して TextBox コントロールのオートコンプリート カテゴリを指定する方法を次のコード例に示します。
<%@ Page Language="VB" %> <html> <body> <form runat="server"> <!-- You need to enable the AutoComplete feature on --> <!-- a browser that supports it (such as Internet --> <!-- Explorer 5.0 and later) for this sample to --> <!-- work. The AutoComplete lists are created after --> <!-- the Submit button is clicked. --> <h3>AutoCompleteType example</h3> Enter values in the text boxes and click the Submit <br/> button. <br/><br/> <!-- The following TextBox controls have different --> <!-- categories assigned to their AutoCompleteType --> <!-- properties. --> First Name:<br/> <asp:textbox id="FirstNameTextBox" autocompletetype="FirstName" runat="server"/> <br/> Last Name:<br/> <asp:textbox id="LastNameTextBox" autocompletetype="LastName" runat="server"/> <br/> Email:<br/> <asp:textbox id="EmailTextBox" autocompletetype="Email" runat="server"/> <br/> <!-- The following TextBox controls have the same --> <!-- categories assigned to their AutoCompleteType --> <!-- properties. They share the same AutoComplete --> <!-- list. --> Phone Line #1:<br/> <asp:textbox id="Phone1TextBox" autocompletetype="HomePhone" runat="server"/> <br/> Phone Line #2:<br/> <asp:textbox id="Phone2TextBox" autocompletetype="HomePhone" runat="server"/> <br/> <!-- The following TextBox control has its --> <!-- AutoCompleteType property set to --> <!-- AutoCompleteType.None. All TextBox controls --> <!-- with the same ID across different pages share --> <!-- the same AutoComplete list. --> Category:<br/> <asp:textbox id="CategoryTextBox" autocompletetype="None" runat="server"/> <br/> <!-- The following TextBox control has the --> <!-- AutoComplete feature disabled. --> Comments:<br/> <asp:textbox id="CommentsTextBox" autocompletetype="Disabled" runat="server"/> <br/> <br/><br/> <asp:button id="SubmitButton" text="Submit" runat="Server"/> </form> </body> </html>
<%@ Page Language="C#" %> <html> <body> <form runat="server"> <!-- You need to enable the AutoComplete feature on --> <!-- a browser that supports it (such as Internet --> <!-- Explorer 5.0 and later) for this sample to --> <!-- work. The AutoComplete lists are created after --> <!-- the Submit button is clicked. --> <h3>AutoCompleteType example</h3> Enter values in the text boxes and click the Submit <br/> button. <br/><br/> <!-- The following TextBox controls have different --> <!-- categories assigned to their AutoCompleteType --> <!-- properties. --> First Name:<br/> <asp:textbox id="FirstNameTextBox" autocompletetype="FirstName" runat="server"/> <br/> Last Name:<br/> <asp:textbox id="LastNameTextBox" autocompletetype="LastName" runat="server"/> <br/> Email:<br/> <asp:textbox id="EmailTextBox" autocompletetype="Email" runat="server"/> <br/> <!-- The following TextBox controls have the same --> <!-- categories assigned to their AutoCompleteType --> <!-- properties. They share the same AutoComplete --> <!-- list. --> Phone Line #1:<br/> <asp:textbox id="Phone1TextBox" autocompletetype="HomePhone" runat="server"/> <br/> Phone Line #2:<br/> <asp:textbox id="Phone2TextBox" autocompletetype="HomePhone" runat="server"/> <br/> <!-- The following TextBox control has its --> <!-- AutoCompleteType property set to --> <!-- AutoCompleteType.None. All TextBox controls --> <!-- with the same ID across different pages share --> <!-- the same AutoComplete list. --> Category:<br/> <asp:textbox id="CategoryTextBox" autocompletetype="None" runat="server"/> <br/> <!-- The following TextBox control has the --> <!-- AutoComplete feature disabled. --> Comments:<br/> <asp:textbox id="CommentsTextBox" autocompletetype="Disabled" runat="server"/> <br/> <br/><br/> <asp:button id="SubmitButton" text="Submit" runat="Server"/> </form> </body> </html>

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

- TextBox.AutoCompleteType プロパティのページへのリンク