textboxs change size between design and run time

VS 2008

I have a form with two textboxes and two buttons. the two text boxes are above each other and the buttons side by side below.

The two textboxes are the same width and as wide as the width from left edge of button one to right edge of button two.

When I run it both text boxes become wider. one is a password and this is not as wide as the other text box but both are wider than they were at design time.

Why? How do I fix?

TIA
LVL 13
Atdhe NuhiuAsked:
Who is Participating?
 
EspavoCommented:
<asp:TextBox ID="thisTb" runat="server" style="width: 100px; height: 20px;" />
BTW, my experience is that rows and columns doesn't work as well as specifying the width and height in px...
0
 
EspavoCommented:
Have you specified their widths, etc.?
style="width: 100px;"
0
 
Faheem ShaikhCommented:
Specify the size of the text box as follows using the attributes columns and rows:
A TextBox with height:
<asp:TextBox id="tb6" rows="5" TextMode="multiline"
runat="server" />
<br /><br />

A TextBox with width:
<asp:TextBox id="tb5" columns="30" runat="server" />
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
vs1784Commented:
Post some code?
0
 
Atdhe NuhiuAuthor Commented:
This what I have at the moment top


changing it to the second bit make the textboxes stay the same as each other but slightly wider than at design.

I'll try the columns next.

    <asp:TextBox ID="txtLogin" runat="server" 
      style="position:absolute; top: 290px; left: 226px;"></asp:TextBox>
 
    <asp:TextBox ID="txtPassword" runat="server" 
      style="position:absolute; top: 326px; left: 226px;" TextMode="Password"></asp:TextBox>
 
*****************************************************************
 
    <asp:TextBox ID="txtLogin" runat="server" 
      style="position:absolute; top: 290px; left: 226px; width: 128px;"></asp:TextBox>
    <asp:TextBox ID="txtPassword" runat="server" 
      style="position:absolute; top: 326px; left: 226px; width: 128px;"  TextMode="Password"></asp:TextBox>

Open in new window

0
 
Atdhe NuhiuAuthor Commented:
This makes them the correct size at design but the expand by different amounts at run time.


<asp:TextBox ID="txtLogin" runat="server" columns="20"
      style="position:absolute; top: 290px; left: 226px; "></asp:TextBox>
    <asp:TextBox ID="txtPassword" runat="server" columns="20"
      style="position:absolute; top: 326px; left: 226px; "  TextMode="Password"></asp:TextBox>

Open in new window

0
 
Atdhe NuhiuAuthor Commented:
So I need to work out the design time width that gives me the required run time width?

Why is it not wysiwyg?
0
 
EspavoCommented:
:-)... I have the same problem with most of the pages I work on...
Seems in Design view there is some "paddiing" that is added from somewhere, just to irritate me (us)...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.