0
elementHost 컨트롤을 사용하여 WinForms에서 WPF 컨트롤을 호스팅하고 있습니다. elementHost (높이)에서 그 이상으로 괘선 위치의 크기를 조정하려고하면 안쪽의 자식 컨트롤이 가운데에 배치되고 그 주위에 검은 색 테두리가 나타납니다. 호스트 컨트롤과 일치하도록 아이의 크기를 수정하려고해도 아이 콘의 크기가 여전히 "중앙에 위치"하고 아이의 일부가 잘리고 잘리지 않습니다. 어떤 도움요소 호스트가 자식의 크기를 올바르게 조정하지 않습니다.
이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.
감사 :
여기 (크기 조정 형태의 이벤트 핸들러) 내 크기 조정 코드입니다!
안녕하세요 에이단 - 자신 만의 질문을 해결 한 경우 해답을 답변으로 게시하고 기간이 경과 한 후 수락 됨으로 표시하십시오. 그러면 질문은 실제로 사이트 전체에서 "답변"된 것처럼 보입니다. –
해결책에 해결책을 넣고 받아들입니다. – EricSchaefer