473,394 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Resizing a textbox at runtime?

Hi,

I am trying to resize a textbox at runtime depending on the browser but for
whatever reason, the textbox is not resized. It stays at the original size.
How can I do what I want?

Here's the code I have in my web user control:

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
Dim browser As String = Request.Browser.Type.ToUpper

If browser.IndexOf("NETSCAPE") > -1 Or browser.IndexOf("NS") > -1
Then
textBoxWidth = 15
ElseIf browser.IndexOf("IE") > -1 Then
textBoxWidth = 75
ElseIf browser.IndexOf("OPERA") > -1 Then
textBoxWidth = 15
End If

txtUser.Width = New UI.WebControls.Unit(textBoxWidth)
End Sub
Nov 17 '05 #1
0 1329

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: fragget | last post by:
Does anyone have experience drawing a selection box around runtime controls. I foundthe ControlPaint.DrawSelectionRectangle (or whatever it is, however it doesn't have the nubs for resizing the...
2
by: jbmeeh | last post by:
I have an application in which I need to expose runtime moving and resizing of controls. Most of the functionality that I need is exposed by the CRectTracker class in the C++ library. Are there any...
8
by: Grant | last post by:
Hello, Ive got a form with 3 textboxes - one under the other. When I set the anchor to top, left, right, and bottom for each of them and resize the form at runtime, they change size in relation...
1
by: Benz. | last post by:
Hello all, I'm having a very strange problem. I've an MDI application with many child forms. In 1 of my Child forms (Say frmA), I've a few design time controls. The forms Autoscroll property is...
13
by: Martin Ho | last post by:
I know this must be trivial for many of you. But I am playing with this and can't figure it out. I have a form, on that form is one panel which has 3 textboxes, when I run my program and...
11
by: jcrouse | last post by:
What is the easiest way to do this? I'm creating a layout designer type application Thanks John
3
by: arashamiri | last post by:
Hi, I wrote an auto resizing textarea: function myMax(anumber, another) { if (anumber > another) { return anumber; } return another; }
1
by: Eric Wong | last post by:
Using Tkinter, I have a Canvas with vertical Scrollbar attached. At runtime, I dynamically create Checkboxes on the Canvas, each one on a different row. When I add a lot of Checkboxes, instead of...
1
by: Nick | last post by:
Hi, I have created a html page from Java and I have added a .js file which can resize a TextArea inside the html on mousedown event. <script src="C:\temp\resize.js"</script> <table<tr><td...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.