Re: TextBox Style Like Label?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: James Thomas (Rasdan_at_nospam.nospam)
Date: 01/07/05


Date: Fri, 07 Jan 2005 22:59:48 -0000

I have used CSS to accomplish the reverse (make a label appear like a
textbox) but it should be easily done using CSS, something similar to
below perhaps:

/* Works for all textboxes */
input {
        border: none;
        background-color: <page background color>
}

/* Works for textboxes with a class of label
input.label {
        <same as above>
}

I tested this briefly on my development machine and it works like a
charm.

John Saunders wrote:

> "localhost" <primpilus@cohort.ces> wrote in message
> news:s3jtt053r6qvs1u3r0j37e5frqloev3rf7@4ax.com...
> >
> > How can I style a TextBox so it appears like a label when rendered?
>
> I don't think you can. A TextBox and a Label are two different
> things. A Label renders "like a label" not because of its styles, but
> because the Label control renders as a <span/> element. A TextBox
> renders as a text box because it renders as a <input type="text">
> element.
>
> John Saunders



Relevant Pages

  • Re: Write, Move, Delete text on PictureBox
    ... Simply place a Label control ... Now, whenever you want create a Label, you would just use ... TypeOf FormOrPictureBox Is PictureBox Then ... Public Sub TransferTextFromTextBoxToLabel(TB As TextBox, ...
    (comp.lang.basic.visual.misc)
  • Re: Write, Move, Delete text on PictureBox
    ... Simply place a Label control ... Now, whenever you want create a Label, you would just use ... Public Sub TransferTextFromTextBoxToLabel(TB As TextBox, ... Before using the dynamic TextBox, ...
    (comp.lang.basic.visual.misc)
  • Re: Write, Move, Delete text on PictureBox
    ... Simply place a Label control on ... Now, whenever you want create a Label, you would just use this code ... Public Sub TransferTextFromTextBoxToLabel(TB As TextBox, ... Before using the dynamic TextBox, you must initialize the module variables. ...
    (comp.lang.basic.visual.misc)
  • Re: Write, Move, Delete text on PictureBox
    ... Simply place a Label control ... Now, whenever you want create a Label, you would just use ... TypeOf FormOrPictureBox Is PictureBox Then ... Public Sub TransferTextFromTextBoxToLabel(TB As TextBox, ...
    (comp.lang.basic.visual.misc)
  • Re: Write, Move, Delete text on PictureBox
    ... Public Function WYSIWYG_TextBoxText(TB As TextBox) As String ... Simply place a Label control ... Now, whenever you want create a Label, you would just use ... Err.Raise 10001, "InitializeTextBox Subroutine", _ ...
    (comp.lang.basic.visual.misc)