TechArena Community

TechArena Community (
-   Software Development (
-   -   .net Compact Framework autosize textbox (

Avanindra 04-06-2009 07:08 PM

.net Compact Framework autosize textbox
I am having a textbox on the form & want to change the textbox to autosize the box with the text feild in it. Actually my Question how to fill the next column with the texbox???

When TextBox->Width="Auto" And TextBox->HorizontalAlignment="Stretch" I get a big TextBox because it is adjusted based on the Text inside the TextBox. Is there any way to work on it...??? Please Help....!

Zecho 04-06-2009 07:18 PM

Re: .net Compact Framework autosize textbox
The problem to solve, we use the native API DrawText. It calculates the size character type selected of the text in conformity with the uFormat parameters and the use of the images (device context).


static extern int DrawText(IntPtr hdc, string lpStr, int nCount, ref Rect lpRect, int wFormat)

kelfro 04-06-2009 07:24 PM

Re: .net Compact Framework autosize textbox
Instead of, manually you should try the size a view of the Premium attribute and leave you Windows automatically the size of the text box. If you remember that most devices know between Hoch-und the landscape format opinion with only one depressing the key, then you should avoid it, hard coding somewhat. It is better, fine vote of elements position and size with the anchor attribute.

All times are GMT +5.5. The time now is 04:12 PM.