This is a migrated thread and some comments may be shown as answers.

How change the textbox height?

7 Answers 620 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Qakmak
Top achievements
Rank 1
Qakmak asked on 08 May 2013, 10:55 AM
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 ?

7 Answers, 1 is accepted

Sort by
0
Qakmak
Top achievements
Rank 1
answered on 11 May 2013, 08:58 AM
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.
0
Anton
Telerik team
answered on 13 May 2013, 06:32 AM
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?
0
Qakmak
Top achievements
Rank 1
answered on 13 May 2013, 04:25 PM
can change the padding property, but can't use Negative number like other control. so I think it's not very helpful.
0
Accepted
Anton
Telerik team
answered on 16 May 2013, 01:24 PM
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?
0
Qakmak
Top achievements
Rank 1
answered on 17 May 2013, 04:19 AM
ok. thanks.
0
Moti
Top achievements
Rank 1
answered on 06 Oct 2015, 11:39 AM

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

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 06 Oct 2015, 12:39 PM
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

Tags
TextBox
Asked by
Qakmak
Top achievements
Rank 1
Answers by
Qakmak
Top achievements
Rank 1
Anton
Telerik team
Moti
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or