[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

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
0
Philip Pinnell
Asked:
Philip Pinnell
3 Solutions
 
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
 
vs1784Commented:
Post some code?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
Philip PinnellAuthor 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
 
Philip PinnellAuthor 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
 
Philip PinnellAuthor 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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now