|
Article relates to
|
RadForm for WinForms
|
|
Created by
|
Tsvetan Raykov, Telerik
|
|
Last modified
|
June 23, 2008
|
|
Last modified by
|
Tsvetan Raykov, Telerik
|
HOW-TO
Resize an ActiveX control in RadForm
DESCRIPTION
Currently
RadForm does not resize
ActiveX controls that are anchored or docked inside the form. For example this issue occurs when a
WebBrowser is dropped on a
RadForm and the form is maximized at run time.
SOLUTION
The solution is to resize the
ActiveX control when resizing the form:
- Set an appropriate size for your ActiveX control.
| this.webBrowser1.Size = new System.Drawing.Size(1024, 768); |
- Process the Resize event of the form.
| Resize += new System.EventHandler(this.frmWindow_Resize); |
| private void frmWindow_Resize(object sender, EventArgs e) |
| { |
| Point pt = (Point)this.Size; |
| radTitleBar1.Width = pt.X; |
| webBrowser1.Width = pt.X - 20; |
| webBrowser1.Height = pt.Y - 30; |
| } |
The above will allow you to expand and contract the window by using the form's handles or using the
Maximize/Restore on the title bar. If you have a custom title bar this
code will also allow it to resize according to the window size.
Please
Sign In
to rate this article.