TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   .net Compact Framework autosize textbox (http://forums.techarena.in/software-development/1191948.htm)

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).


Code:

[DllImport("coredll.dll")]
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.