I'm hosting a WPF control in WinForms using the elementHost control. When I try to resize the elementHost (in height) any further then the orignal position, the child control inside is centered and black borders appear around it. When I try to modify the child's size to match the host control, it still "centers" it and part of the child is cut off and cant fit.
Here is my resize code (which is in the form resize event handler):
elementHost1.Height = ClientSize.Height - h;
elementHost1.Width = ClientSize.Width - w;
(elementHost1.Child as WPFCodeBox).textEditor.Height = ClientSize.Height - h;
(elementHost1.Child as WPFCodeBox).textEditor.Width = ClientSize.Width - w;
(elementHost1.Child as WPFCodeBox).Border.Width = ClientSize.Width - w;
(elementHost1.Child as WPFCodeBox).Border.Height = ClientSize.Height - h;
Where h is the distance from the bottom of the form to the bottom of the element host
same for w but in width.
Thanks for any help!