How to set the with of a textbox so it fits exactly

Discussion in 'ASP .Net Building Controls' started by ton, Feb 10, 2004.

  1. ton

    ton Guest

    In my composite control I use a table object with cell and row objects. A
    Textbox is added to this control. How can I set the width of the textbox so
    it fits. If I set a to high value, the table is much to wide, if it is to
    short, the textfield will scroll in the tablecell, and it is not nice to
    see.

    So Question one:
    - how to set the with depending on textlength and font (webcontrol!!)
    - how to adjust the wordwrap behaviour in a table (No wordwrap)

    Thanx

    Ton
     
    ton, Feb 10, 2004
    #1
    1. Advertising

  2. For the 1st question :
    Why would you want to expand the textbox based on the width of characters.
    If you have a textfield which takes input more than 50 characters then set
    the textbox to multiline, depending on your needs. I'm saying 50 off the top
    of my head. Having a textfield expand depending on the amount of characters
    is not a very good idea, and you'd have to get into client side scripting to
    achieve this.

    word wrap for a cell ? Have you tried setting a fixed width for the cell.
    This should work.


    "ton" <> wrote in message
    news:c0b3mf$8uv$1.nb.home.nl...
    > In my composite control I use a table object with cell and row objects. A
    > Textbox is added to this control. How can I set the width of the textbox

    so
    > it fits. If I set a to high value, the table is much to wide, if it is to
    > short, the textfield will scroll in the tablecell, and it is not nice to
    > see.
    >
    > So Question one:
    > - how to set the with depending on textlength and font (webcontrol!!)
    > - how to adjust the wordwrap behaviour in a table (No wordwrap)
    >
    > Thanx
    >
    > Ton
    >
    >
     
    Alessandro Zifiglio, Feb 11, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kerry Shetline
    Replies:
    1
    Views:
    6,206
    Kerry Shetline
    Sep 4, 2003
  2. William Z.
    Replies:
    0
    Views:
    481
    William Z.
    Mar 22, 2006
  3. Replies:
    9
    Views:
    19,650
  4. jbrewer

    PIL FITs image decoder

    jbrewer, Nov 22, 2005, in forum: Python
    Replies:
    8
    Views:
    1,744
    jbrewer
    Nov 23, 2005
  5. Dropstengel
    Replies:
    7
    Views:
    106
    kaeli
    Aug 17, 2004
Loading...

Share This Page