I have a WPF control in an ElementHost on a WinForms form. I've added the Form to a DockPanel Suite pane. The WPF content displays correctly when the Form is floating, or docked left/right/top/bottom, but when DockState is Document the WPF content disappears, leaving a blank docked Form.
I've experimented with creating empty test WPF controls, and this behaviour occurs whenever an ElementHost is used on a WinForm, and docked using DPS. Can anyone suggest where to look for a fix ? I've set the WPF rendering to Software only, but it doesn't help with this problem.
Many thanks.
WinForms App using .NET 4.0, VS2012 on Windows 7 on VMWare Fusion on MacBook Pro.
After much poking around, the problem turned out to be due to a ToolStripContainer that was on the same form as the DPS DockPanel. When the ElementHost form was docked as document, this was being rendered over the top of it. I replaced the ToolStripContainer with a separate ToolStrip and MenuStrip (following the DockSample), and all works fine.
Related
I'm using Modern Metro UI framework installed from Nugetin a Win Forms application and the scrollbars don't take on the styling until interacted with. That includes resizing the application window.
Scroll bar on initial load, not styled:
Style taking affect after using scroll bar:
Any ideas on why this is happening? The scrollbars are not programmatically added. I'm using the metro gridwhich I believe is the data grid view.
I solved this issue by removing the data grid and using a new one.
We have a WPF user control that provides drag and drop functionality. We’ve also used an adorner to provide visual drag/drop feedback to the user about the framework element being dragged. If the hosting application for our user control is WPF, we can drag from the user control and drop to the target control that is hosted in the WPF form and we see the adorner. We have no issues with this scenario.
However, we have an issue because we need this WPF user control to be inside a VB.NET windows form. For our Windows Form project, We added a reference to the WindowsIntegration assembly and added a WPF control inside an ElementHost. This works great and we can drag and drop but the one issue we can’t solve is that when we drag from the user control to the target element hosted in the VB.NET windows form, the adorner doesn’t show.
Please help!
I'm using AvalonEdit in my WinForms application. AvalonEdit is placed onto control with ElementHost on it. Application has RadDock from Telerik and AvalonEdit can be placed on its windows. Often I get problem with ElementHost repainting. I don't know all the symptoms, but I can reproduce this problem by changing focus and moving other windows over the editor. After this all WPF controls in my application become broken and can't be repainted. The only way to force to redraw ElementHost is resizing. I can change for example width and WPF control will be redrawn. But this "solution" is not acceptable. The problem can be reproduced for docked or floating windows, for windows with active scrollbars or without, on x64 and x86 machine. To "fix" ElementHost I need to restart application.
Have somebody any suggestion for me?
Hy!
I create a WPF application. I have a Windows Form element. This control displays the WebCamera picture.
I put it in canvas, 'cause I have to show the recodring time, so I also put a textblock into the canvas. My problem is that, I've already done everything with the From control, for example I set the ZIndex etc., send back, but the WebCam image always the highest lay. I cant send it behind. This element is a System.Windows.Forms.Integration.WindowsFormsHost
Can anybody help me? I hope I could write my problem understandable.
That's not possible. WindowsFormHost is HwndHost, and according to MSDN
HwndHost will appear on top of other WPF elements in the same
top-level window. However, a ToolTip or ContextMenu generated menu is
a separate top-level window, and so will behave correctly with
HwndHost.
Consider following options:
adding overlay controls to WinForms control
placing your overlay WPF controls inside a Popup window (you'll have to handle that window location manually)
look for a WPF control alternative for your WinForms control (or implement your own)
I am developing a sample windows application. In this application, I am making use of WinForms with FormBorderStyle set to sizable. Now, when I run my application, it shows the startup form which is re sizable. This form consist of various windows controls on it.
My problem is, when I resize the form, the controls on it do not get re size automatically.
Does anybody know how to achieve this?
Thanks in advance.
Set The Dock or Anchor properties of your controls accordingly.
Play with it, it's simple.