Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 25th, 2006, 02:16 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Text Box width

Hi all
I am using the width of textbox in %, its changing the width of textbox in case the no. of characters are more.
Though its working fine with width in pixels, but I want a solution for width in %.

Thanks & Regards


  #2 (permalink)  
Old January 25th, 2006, 09:42 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Are you saying that it IS changing based on the number of chars in the textbox, or that you WANT it to change based on the number of chars in it?

-Peter
  #3 (permalink)  
Old January 27th, 2006, 05:33 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie
 Are you saying that it IS changing based on the number of chars in the textbox, or that you WANT it to change based on the number of chars in it?

-Peter
Hi Peter
Thanku so much for the reply.
If data coming from database is lengthier then it expands, I have limited space so I don’t want the textbox to expand.

  #4 (permalink)  
Old January 27th, 2006, 07:36 AM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
I know your meaning,but I don't know how to do it,I'm a newbie in here.
:P

Coffee

A new man .
  #5 (permalink)  
Old January 27th, 2006, 10:46 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Set an explicit width for the textbox control:

<asp:textbox ... width="100" />

-Peter
  #6 (permalink)  
Old February 1st, 2006, 09:27 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie
 Set an explicit width for the textbox control:

<asp:textbox ... width="100" />

-Peter
Hi Peter
Thanku again for ur reply.
But this(<asp:textbox ... width="100" />) sets value in pixels, I want to use %

Thanks & Regards


  #7 (permalink)  
Old February 2nd, 2006, 05:52 AM
Authorized User
 
Join Date: May 2005
Location: pune, maharashtra, India.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Peter,
Why dont you set the Multiline property to TRUE and specify the width in %.

Let me know if it works.

Regards,
Muskaan. :)


  #8 (permalink)  
Old February 3rd, 2006, 07:15 AM
Registered User
 
Join Date: Dec 2005
Location: Hyderabad, Andhra Pradesh, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to munnu Send a message via Yahoo to munnu
Default

Hi toshi,

I agree to Muskaan.
Using the Multiline property to TRUE and specify the width in % will solve the issue.

Regards,
Munavvar

  #9 (permalink)  
Old March 30th, 2006, 03:40 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for ur reply but i have a set format so cant use miltiline textbox too...


  #10 (permalink)  
Old March 30th, 2006, 02:20 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

so what your saying is is that you have a text feed coming from somewhere that has to be on one line? What I recommend doing is something like this

Dim strMyString as string
Dim intLength as integer

///retrieve your data set the string to the above variable

intLength = strMyString.length

///You now know the length of the string so preform your calculation on what
///the width of the text box should be then do this

txtMyBox.style.add("width",[percent])

where percent is how much of the screen you want the box to occupy. Note that this is going to be your only work around pragmatically because the Width() of the text box only accepts an integer. (Unless of course you create a math function that will convert your percent into an integer based upon the available screen size.)

Hope this helps.

"The one language all programmers understand is profanity."


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed Width text file to MSDE with C# mgudmund C# 2005 3 November 9th, 2007 05:09 AM
How to change the width of text box in a Report kishorelakkimsetty Reporting Services 3 May 13th, 2006 01:50 PM
Text Box... Width MER78 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 5 March 3rd, 2006 02:10 PM
Set width on empty select box? acdsky HTML Code Clinic 3 July 27th, 2004 05:41 AM
Finding width of text jerimorris Javascript How-To 4 September 8th, 2003 02:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.