Re: deriving from textbox control
From: Matt Berther (mberther_at_hotmail.com)
Date: 10/22/04
- Next message: Steve: "Dynamic compilation errors"
- Previous message: Lisa Calla: "Re: deriving from textbox control"
- In reply to: Lisa Calla: "deriving from textbox control"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 22 Oct 2004 11:15:28 -0700
Hello Lisa,
Gosh... wouldnt the easier alternative be to use CSS?
input {
border: 1px solid black;
}
-- Matt Berther http://www.mattberther.com > Hi, > I'm trying to control the foreground and background colors of a > textbox. I > hate that light gray foreground when the textbox.enabled=false. I've > tried > to derive a control from the textbox, but I get the following error > when > trying to run a page with the control on it. wc is the name of my > class, > and exp is the name of my project. > Parser Error Message: 'exp.wc' is not a valid base class because it > does not extend class 'System.Web.UI.UserControl'. > > Source Error: > > Line 1: <%@ Control Language="vb" AutoEventWireup="false" > Codebehind="wc.ascx.vb" Inherits="exp.wc" > TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> > > And here's the code: > > Imports System > Imports System.Web.UI > Imports System.Web.UI.WebControls > Public Class wc > Inherits System.Web.UI.WebControls.TextBox > #Region " Web Form Designer Generated Code " > > 'This call is required by the Web Form Designer. > <System.Diagnostics.DebuggerStepThrough()> Private Sub > InitializeComponent() > End Sub > > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Init > 'CODEGEN: This method call is required by the Web Form > Designer > 'Do not modify it using the code editor. > InitializeComponent() > End Sub > #End Region > > 'Private Sub Page_Load(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Load > ' 'Put user code to initialize the page here > 'End Sub > Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs) > If Me.Enabled Then > Me.BackColor = Color.FromName("White") > Else > Me.BackColor = Color.FromName("LightGray") > End If > Me.ForeColor = Color.FromName("Black") > End Sub > End Class > Can anyone explain to me why I get this error? >
- Next message: Steve: "Dynamic compilation errors"
- Previous message: Lisa Calla: "Re: deriving from textbox control"
- In reply to: Lisa Calla: "deriving from textbox control"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|