Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF hosting windows forms elements inside a ScrollViewer

Tags:

wpf

when putting a ScrollViewer inside a window(not keeping all the window's size) inside the ScrollViewer there's (with other stuff) a WinFormsHost and a control inside (let's say a DateTimePicker). when scrolling, the inner winforms control keeps being visible when there's no longer a reason (it's outside of the scrolling region), so it "floats" above what's outside of the ScrollViewer

any solutions for that?

like image 672
user21243 Avatar asked Jan 25 '23 02:01

user21243


1 Answers

According to this msdn link

WindowsFormsHost elements are always drawn on top of other WPF elements, and they are unaffected by z-order

I don't think there's an easy solution. You might want to consider having the windows forms control handle the scrolling itself instead of using WPF's ScrollViewer.

like image 175
Senkwe Avatar answered Jan 30 '23 13:01

Senkwe