textbox text alignment in web app

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emadattalla1983
    New Member
    • Apr 2007
    • 24

    textbox text alignment in web app

    Dear all,

    I face a problem to align the text in textbox to right.
    I want to align it dynamically within the code when click on a button.

    All solutions I found till now were TextBox1.TextAl ignment = ...
    But I do not find this "TextAlignm ent" property show in the TextBox1 !!!
    I found it when creating a windows application.

    I am using C# and it is a web application.

    Thanks
    E A
  • emadattalla1983
    New Member
    • Apr 2007
    • 24

    #2
    Forgot to declare that:

    using System.Web.UI.W ebControls;
    using System.Web.UI.M obileControls;

    are included

    Comment

    • dip_developer
      Recognized Expert Contributor
      • Aug 2006
      • 648

      #3
      Originally posted by emadattalla1983
      Forgot to declare that:

      using System.Web.UI.W ebControls;
      using System.Web.UI.M obileControls;

      are included
      You have to Use CSS for textbox text alignment...... .

      Comment

      • emadattalla1983
        New Member
        • Apr 2007
        • 24

        #4
        Originally posted by dip_developer
        You have to Use CSS for textbox text alignment...... .
        Exactly that what I finally did:
        TextBox1.Style. Value = "font-weight: bolder;\r\n font-size: larger; left: 232px; position: absolute; top: 200px; text-align: left";

        And it worked fine...
        Thanks for help,
        E N

        Comment

        Working...