Output
labelflex.png

ASPX page
<p>
	<asp:Panel runat="server" ID="pnlTest">
		<asp:Label runat="server" ID="lblTest" Text="I'm flexible" Width="100px" />
	</asp:Panel>
</p>
<p>Associated Input: <asp:TextBox runat="server" id="txtInput" /></p>
<axial:WFStartupScript runat="server" MethodName="ShowLabelFlexability" />


Code Behind
public void ShowLabelFlexability()
{
	lblTest.Text = "I'm flexible!";

	//lblTest.AssociatedControlID = txtInput.ClientID;
	lblTest.Attributes["custom"] = "nice";
	lblTest.BackColor = Color.CornflowerBlue;
	lblTest.BorderColor = Color.Orange;
	lblTest.BorderStyle = BorderStyle.Dashed;
	lblTest.BorderWidth = Unit.Pixel(2);
	lblTest.CssClass = "mynewclass";
	lblTest.Font.Bold = true;
	lblTest.Font.Italic = true;
	lblTest.Font.Overline = true;
	lblTest.Font.Size = new FontUnit("20pt");
	lblTest.Font.Strikeout = true;
	lblTest.Font.Underline = true;
	lblTest.ForeColor = Color.Lime;
	lblTest.Style[System.Web.UI.HtmlTextWriterStyle.FontSize] = "36pt";
	lblTest.TabIndex = 3;
	lblTest.ToolTip = "a tooltip";

	pnlTest.BackColor = Color.LightBlue;
	pnlTest.BorderColor = Color.Orange;
	pnlTest.BorderStyle = BorderStyle.Dashed;
	pnlTest.BorderWidth = Unit.Pixel(2);
	pnlTest.Height = new Unit("200px");
	pnlTest.Width = Unit.Percentage(50);
}

Last edited Aug 5, 2008 at 7:29 PM by thasmin, version 2

Comments

No comments yet.