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

Dim instance As CssStyleCollection Dim value As String value = instance.Value instance.Value = value
スタイルの文字列リテラル。

Value プロパティを使用して、ユーザーが送信ボタンをクリックしたときに HtmlSelect コントロールのスタイル属性の一覧を表示する方法を次のコード例に示します。
<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) SubmitBtn.Style.Add("letter-spacing", "10px") FirstSelect.Style.Add(HtmlTextWriterStyle.Color, FirstSelect.Items(FirstSelect.SelectedIndex).Value.ToString()) Message.Style.Add(HtmlTextWriterStyle.Color, FirstSelect.Items(FirstSelect.SelectedIndex).Value.ToString()) Message.Text = "The select style is: " + FirstSelect.Style.Value End Sub </script> <html > <head runat="server"> <title>CssStyleCollection Add</title> </head> <body> <form id="form1" runat="server"> <div> Select a color and then click submit. <br /> <select id="FirstSelect" style="font: 10pt verdana;color:black;" runat="server"> <option value="black">black</option> <option value="red">red</option> <option value="blue">blue</option> <option value="green">green</option> </select> <input id="SubmitBtn" value="Submit" type="submit" OnServerClick="SubmitBtn_Click" runat="server" /><br> <br /> <asp:Label id="Message" runat="server"/> </div> </form> </body> </html>
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void SubmitBtn_Click(object sender, EventArgs e) { SubmitBtn.Style.Add("letter-spacing", "10px"); FirstSelect.Style.Add(HtmlTextWriterStyle.Color, FirstSelect.Items[FirstSelect.SelectedIndex].Value.ToString()); Message.Style.Add(HtmlTextWriterStyle.Color, FirstSelect.Items[FirstSelect.SelectedIndex].Value.ToString()); Message.Text = "The select style is: " + FirstSelect.Style.Value; } </script> <html > <head runat="server"> <title>CssStyleCollection Add</title> </head> <body> <form id="form1" runat="server"> <div> Select a color and then click submit. <br /> <select id="FirstSelect" style="font: 10pt verdana;color:black;" runat="server"> <option value="black">black</option> <option value="red">red</option> <option value="blue">blue</option> <option value="green">green</option> </select> <input id="SubmitBtn" value="Submit" type="submit" onserverclick="SubmitBtn_Click" runat="server" /><br/> <br /> <asp:Label id="Message" runat="server"/> </div> </form> </body> </html>
<%@ Page Language="VJ#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void SubmitBtn_Click(Object sender, EventArgs e) { SubmitBtn.get_Style().Add("letter-spacing", "10px"); FirstSelect.get_Style().Add(HtmlTextWriterStyle.Color, FirstSelect.get_Items().get_Item(FirstSelect.get_SelectedIndex()).get_Value()); Message.get_Style().Add(HtmlTextWriterStyle.Color, FirstSelect.get_Items().get_Item(FirstSelect.get_SelectedIndex()).get_Value()); Message.set_Text("The select style is: " + FirstSelect.get_Style().get_Value()); } </script> <html > <head runat="server"> <title>CssStyleCollection Add</title> </head> <body> <form id="form1" runat="server"> <div> Select a color and then click submit. <br /> <select id="FirstSelect" style="font: 10pt verdana;color:black;" runat="server"> <option value="black">black</option> <option value="red">red</option> <option value="blue">blue</option> <option value="green">green</option> </select> <input id="SubmitBtn" value="Submit" type="submit" OnServerClick="SubmitBtn_Click" runat="server" /><br> <br /> <asp:Label id="Message" runat="server"/> </div> </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に収録されているすべての辞書からCssStyleCollection.Value プロパティを検索する場合は、下記のリンクをクリックしてください。

- CssStyleCollection.Value プロパティのページへのリンク