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

RadTexBox sizing

10 Answers 154 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 09 Jun 2007, 06:00 PM
Okay folks you got me confused on this one.

I gather that the height setting of the RadTextBox is based on the font size being used within the textbox. The problem is that the text is too close to the bottom edge of the textbox. The spacing between the top edge of the textbox and the actual text is fine but the bottom edge of the textbox does not have the same spacing.

this would be okay - sorta - if you could manually adjust the height of the textbox but I have note been able to find where this can be done. I have tried setting the height size from wothin the RootElement tree (Size) and from the standard Size setting but thet both automatically reset to the intial height size set when the control is placed or the font size is changed.

Steven Hodson
WinExtra / Hodson Report
http://www.winextra.com
http://www.hodsonreport.com

10 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 11 Jun 2007, 10:45 AM
Indeed the height of the RadTextBox cannot be changed and this is by design (MS textbox has the same behavior). The height changes only proportionally to the font size. Do you think that we need to consider changing this behavior? It will be a trivial feature which we can add for the next minor version.

As to the problem with the location of the text, indeed, we were able to confirm it. It appears when the font size is set to certain values. It is in our TODO list and it'll be fixed for the Q2 2007 release. Your points have been updated for the report.

Let us know if you find anything else - we will be glad to review it for you.
 

Sincerely yours,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Steven
Top achievements
Rank 1
answered on 11 Jun 2007, 04:12 PM
I realized the silliness of my thought on the textbox height after posting - sorry about that - I realize that the height is suppose to be tied to the font size.

However the problem that sparked the post is the one you plan on addressing so all is good :)

Steven Hodson
WinExtra / Hodson Report
http://www.winextra.com
http://www.hodsonreport.com
0
Sergio
Top achievements
Rank 1
answered on 08 Aug 2007, 09:59 PM
Georgi,

I'm having a similar problem.  But it has to do with the amount of padding that the TextBox contains.  The control is functioning as if you had set Borders = None on a standard WinForms control.

I would like it function more like a standard TextBox with the extra padding between the text and the border.  (It can auto-adjust its height based on the font size, but the padding should still be there).

Sergio
0
Georgi
Telerik team
answered on 09 Aug 2007, 09:06 AM
Hi Sergio,

To set the padding between the text and the border you could use the Padding property of the control or the RadTextBoxElement (this functionality is available from the Q1 2007 SP2 release). You could set it to the desired value either at design-time or directly by code or when implementing a custom theme.

If you have any additional questions, please don't hesitate to ask us.
 

All the best,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sergio
Top achievements
Rank 1
answered on 09 Aug 2007, 04:17 PM
Georgi,

Ok.  Here's the further problem: I turned on the 4 borders option, because my client just wants a bottom border.  When I increase the padding, there is some separation between the entry area and the border.  Is there a way to make that white, or just increase the padding within the entry area (which should increase the space between the text and the internal edges of the entry rectangle)?

Secondly, I was trying to do this all with a theme.  So an additional question I have is that I saw where I can adjust the theme on a mouseover, can I adjust the theme when the control has focus? 

And finally, how can I get the theme creator dialog box to more accurately represent what's happening?  It doesn't quite show the correct style when they are set.  Also, if I make a change to a theme, it doesn't automatically reflect in the UI.  I have to close the form designer and reopen it.

Thanks,
  Sergio
0
Georgi
Telerik team
answered on 10 Aug 2007, 03:24 PM

Hello Sergio,

Thank you for contacting us.

As to the first problem, the area that appears between the text and the border is in fact the fill primitive that is behind the entry area. This primitive takes the whole area between the borders (in our examples, you could use RadControlSpy to explore the structure of the textbox). You can change its color as you like in the theme or by code. 

As to the second question, using Visual Style Builder you have to locate the RadTextBoxItem in the hierarchy and add a new state to it. Then create a condition with property set to RadElement.IsFocused property and Value set to true.

As it comes to the Visual Style Builder, can you please elaborate a bit more on what exactly you find inaccurate when editing a theme? The preview part of the VSB shows the corresponding control in the same way as it will appear on the form (with all states applied). The design pane shows the selected element as it would appear in the selected "state" only. For more information on the Visual Style Builder I will recommend the two WinForms videos here and Build Great User Interfaces with the VisualStyleBuilder for Telerik Windows Forms whitepaper.

The last problem you mention appears because Visual Style Builder does not refresh the theme that has been loaded in the memory of the Visual Studio designer when you save the theme. We will consider adding this functionality for the next major update. 

Let us know if you have other questions.
 
 

Best wishes,

Georgi

the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
0
kerstin
Top achievements
Rank 1
answered on 25 Oct 2007, 09:06 PM
I am using the Q2 2007 build of the Winforms Build and i am still not able to set the height how i would like to have it -whether manually nor through code? Is there a workaround?
0
Georgi
Telerik team
answered on 29 Oct 2007, 01:03 PM
Hello Kerstin,

Thank you for writing.

The RadComboBox has almost the same layout behavior as the standard MS combobox. By default, the height of the RadComboBox cannot be changed. Instead, it is tied to the font size so when it changes the height changes accordingly. However, you can use its Padding property to set a different height. 

On the other hand, if the Multiline property of the RadComboBox is set to true, you can change its height either at design-time or at runtime (through the code). 

Please don't hesitate to write us if you have any additional questions.

Greetings,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
kerstin
Top achievements
Rank 1
answered on 30 Oct 2007, 01:45 PM
So when can we expect to have the ability to set a height in the RADTEXTBOX?
0
Angel
Telerik team
answered on 01 Nov 2007, 03:54 PM
Hi Kerstin,

You currently have the ability to set the height of the RadTextBox. When the RadTextBox is in single line mode, the height of the text area is calculated dynamically. The only way to increase the height of the RadTextBox is to increase the Padding values. The height of the entire RadTextBox equals the height of the text area, plus top and bottom paddings.

For additional information, refer to this KB article:

http://www.telerik.com/support/kb/article/b454K-meh-b454T-ckt-b454c-ckt.aspx

If you have further questions, don't hesitate to contact us.

Kind regards,
Angel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TextBox
Asked by
Steven
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Steven
Top achievements
Rank 1
Sergio
Top achievements
Rank 1
kerstin
Top achievements
Rank 1
Angel
Telerik team
Share this question
or