How change the textbox height?

8 posts, 1 answers
  1. Qakmak
    Qakmak avatar
    20 posts
    Member since:
    Apr 2013

    Posted 08 May 2013 Link to this post

    because my font is special, so I need change It size. like 10.5f.  but textbox size change too. and I need change textbox height. so I'm use Visual Style builder, and open a default theme, and change RadTextBox--->RadTextBoxElement--->TextBoxFill, and I try to change it font and padding , and margin. but, padding and margin cannot be change . so ....how can I do ?
  2. Qakmak
    Qakmak avatar
    20 posts
    Member since:
    Apr 2013

    Posted 11 May 2013 Link to this post

    I mean. If I'm change my font size. textbox size changed to .
    and that textbox looks like very large. so I think maybe I can remove little textbox padding. and let the textbox looks like small.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Anton
    Admin
    Anton avatar
    167 posts

    Posted 13 May 2013 Link to this post

    Hi Qakmak,

    Thank you for writing.

    RadTextBox internally contains the standard MS TextBox controls. So, when the font size of RadTextBox is changed, the inner textbox font is changed too. Since the former is auto sizing itself according to its content, when the inner textbox size is changed, RadTextBox increases its size to accommodate it. In order to reduce the space between RadTextBox and the embedded control, you should use the Padding property as shown on the attached picture.

    I hope this helps.

    Regards,
    Anton
    the Telerik team
    RadChart for WinForms is obsolete. Now what?
  5. Qakmak
    Qakmak avatar
    20 posts
    Member since:
    Apr 2013

    Posted 13 May 2013 Link to this post

    can change the padding property, but can't use Negative number like other control. so I think it's not very helpful.
  6. Answer
    Anton
    Admin
    Anton avatar
    167 posts

    Posted 16 May 2013 Link to this post

    Hello Qakmak,

    Thank you for writing back.

    With this Padding property you are controlling the space between RadTextBox and the embedded control. The embedded MS TextBox is not created with our Telerik Presentation Framework (TPF) so it is independent from our styling properties like Padding. That is why it is not exposed like element in VisualStyleBuilder. In order to access the embedded MS TextBox you should use the following code snippet:
    TextBox embeddedTextBox = this.radTextBox1.TextBoxElement.TextBoxItem.HostedControl as TextBox;

    Please note that the MS TextBox does not support Padding. You can read more about padding in MS controls here.

    So you cannot reduce the space between the borders of RadTextBox and the text inside more than you can do with the Padding property of RadTextBoxElement. My advice is to try to achieve the desired behavior with RadTextBoxControl instead RadTextBox. RadTextBoxControl is control entirely developed by us without embedding the MS TextBox.

    I hope this information helps. 

    All the best,
    Anton
    the Telerik team
    RadChart for WinForms is obsolete. Now what?
  7. Qakmak
    Qakmak avatar
    20 posts
    Member since:
    Apr 2013

    Posted 16 May 2013 Link to this post

    ok. thanks.
  8. Moti
    Moti avatar
    5 posts
    Member since:
    Jan 2014

    Posted 06 Oct 2015 Link to this post

    Hello

    I use RadTextBoxControl.

    I want to change the size of the RadTextBoxControl.

    When I try to change the size via the size property it's not effective on the control

    When I change the font size it's also not effective on the control size

    Thanks.

    Moti

     

     

  9. Dess
    Admin
    Dess avatar
    1605 posts

    Posted 06 Oct 2015 Link to this post

    Hello Moti,

    Thank you for writing.

    In order to customize RadTextBoxControl size you can set the Height and Width properties:
     
    public Form1()
    {
        InitializeComponent();
     
        this.radTextBoxControl1.Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
        this.radTextBoxControl1.Height = 40;
        this.radTextBoxControl1.Width = 300;
    }

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik

Back to Top
UI for WinForms is Visual Studio 2017 Ready