This project is read-only.

textbox width question

Sep 11, 2013 at 9:02 PM

When using one of the layouts (label/control) I can use mvvm:View.WidthEx to specify the width of the column - nice. But what if I want the textbox to simply extend the width of the current column/page/whatever? Would I use the WPF settings or an ...Ex setting to do this?

Also, is there a quick reference to the Ex extensions you have added?

Sep 19, 2013 at 5:50 AM
There aren't too many ...Ex extensions like that. You can see them on the View object or in the class reference for the View object (and the object it inherits from, which is called SimpleView). The ones that might be of interest to you however are MinWidthEx and MaxWidthEx. When you set those, they only set the min/max width of the control, in which case the control can auto-grow as text is entered (which I think is what you want to achieve, if I understand the question).

Sep 20, 2013 at 9:36 PM

In my case, I just want to tell the textbox (or whatever) to stretch to the end of the column, whatever it is. When your layouts align the label and the control, they also put the control pairs in columns. I won't know the width of the column until the layout style/code is applied. So I simply want the textbox width to be the maximum that it can be while still staying in the column (and not messing up the calculations for the column widths).

so if I have 10 label/control pairs and the 5th has a column break reference, how can I set it so that the left of the 1st textbox is where it normally is, but the width of that textbox extends to the edge of the column - which is calculated based on the form width.

I need this for some multiline textboxes where I don't want the width of those textboxes to dictate the calculated width of the column.

Since it appears that this is not in the code, could you point me to the code that does the current column width calculations so I can see if I want to add such a feature?


Sep 23, 2013 at 7:11 AM
Yeah, this sounds like the opposite approach and not what it currently does. The edit form layout panel is completely driven by the widths of controls in the columns. The column width never drives control width. To do that, it would be best to create a new layout control and style that in instead.