views:

45

answers:

1

Hello everyone,

I'm fairly new to C#, I'm on a C# & Wpf course. Here my teacher has told us to inherit from UserControls and create a wpf control library of our own. In order for us to create a simple UML Editor, and right now I'm working on a Class Control.

The visual representation of a class as seen here: http://www.softwarefactories.com/ScreenShots/CD-1.JPG

Now, to make things easy for the end user and me as the developer, the fields contained in the class control contain editable textboxes. The fields can dynamically be added to the control, for instance if the class doesn't have any member variables, it won't need a "property" field, and if the user would like to add a "description", he/she may do so easily.

That part is done, but right now the TextBoxes don't adapt in size when edited; the user can add a line, but it won't resize the textbox.

What I want to do is to create an eventhandler of some sort, and have a function run whenever the user changes the content of the textbox.

-How is this done? Thank you for your time.

A: 

Yes, you were absolutely right it's just that I handled the layout wrong further up in the code. Anyway, it uses only a constant set of textboxes, so i just defined those in xml and set the height to auto like it should be. In a stackpanel, they align neatly on top of oneanother. Thanks for your help, dnr3!

Daniel