B
Ben
Hi,
i want to change the forecolor of a label by choosing the color in a
dropdownlist like this:
<aspropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="red" Value="Drawing.Color.red"></asp:ListItem>
</aspropDownList>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Label1.ForeColor = CType(DropDownList1.SelectedValue, System.Drawing.Color)
End Sub
i get the error: "value ype string caanot converted to
System.Drawing.Color".
Why does the conversion not occur?
Thanks
Ben
i want to change the forecolor of a label by choosing the color in a
dropdownlist like this:
<aspropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="red" Value="Drawing.Color.red"></asp:ListItem>
</aspropDownList>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Label1.ForeColor = CType(DropDownList1.SelectedValue, System.Drawing.Color)
End Sub
i get the error: "value ype string caanot converted to
System.Drawing.Color".
Why does the conversion not occur?
Thanks
Ben