Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Scrolling in Integration.Elementhost
 

Scrolling in Integration.Elementhost

Hi,

I am using Integration.Elementhost control in my application.
I using this as a container to host some other controls.
The number of controls can be added dynamically. Because of this, the size the control is going beyond the screen.
To avoid this problem i wanted to add scroll functionality to the Integration.Elementhostcontrol. I could not find Autoscroll property.
Can someone please let me know if this is possible.

Thanks,
Shail
Shailendra_G  Tuesday, August 25, 2009 7:37 PM
Hi Shailendra_G,

Elementhost control is used to host WPF control into Winform application. Like you said, it doesn't have AutoScroll property. I got 2 idea which you can try.
1. Add a Panel to the form, set its AutoScroll property to true. Then add ElementHost control into the panel, set its AutoSize property to true. Panel control will show scroll bar when inside control grow larger than panel's size.

2. Enable scroll in WPF instead of in Winform. You can use ScrollViewer control(WPF control) to let the control scrollable.

If you have any problem with my suggestion, please feel free to tell me.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
  • Marked As Answer byShailendra_G Thursday, August 27, 2009 2:32 PM
  •  
Kira Qian  Thursday, August 27, 2009 7:20 AM
Hi Shailendra_G,

Elementhost control is used to host WPF control into Winform application. Like you said, it doesn't have AutoScroll property. I got 2 idea which you can try.
1. Add a Panel to the form, set its AutoScroll property to true. Then add ElementHost control into the panel, set its AutoSize property to true. Panel control will show scroll bar when inside control grow larger than panel's size.

2. Enable scroll in WPF instead of in Winform. You can use ScrollViewer control(WPF control) to let the control scrollable.

If you have any problem with my suggestion, please feel free to tell me.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
  • Marked As Answer byShailendra_G Thursday, August 27, 2009 2:32 PM
  •  
Kira Qian  Thursday, August 27, 2009 7:20 AM
Hi Kira,

That was awesome. Your second idea worked like wonders.
That was the simplest solution and absolutely served my purpose.

Thanks a ton for the quick resolution.

Thanks,
Shail
Shailendra_G  Thursday, August 27, 2009 2:31 PM

You can use google to search for other answers

Custom Search

More Threads

• designer can't load form. Where is 'more information'?
• Using WMI to get date and time on a remote computer
• Display User Control while accessing data?
• MDI parent with image at the right bottom
• Resize the combobox arrow
• Drawing images and manipulating with that
• Resource View Crashes Yet Again
• inherited form constructor not found warning message
• C# TabOrder Problem in disable button
• Selecting a control from the form's control collection