How to show a custom interface control in a Window

Hi all,

I have a problem with showing a sub-classed HTMLviewer on a Window.

Normally, I sub-class a control and then add it to a Window by dragging it from the Library to the Window. However now I have to show that custom made control, which is visible in the library by code.

I searched this forum, the internet but cannot find what I am looking for.

This is the code I have :

  1. I created a sub-class “clsBrowser” As HTMLviewer

In the “Open” event handler of the Window “frmBrowser” I have :

clssBrowser = New clsBrowser
clssBrowser.LoadURL (“”)
// Position and dimensions of custom browser
clssBrowser.Left = 10
clssBrowser.Width = 800
clssBrowser.Top = 100
clssBrowser.Height = 600

Now I want to show the browser on the window. I taught I did this before long ago, but cannot remember.

Do you know how I can show the clssBrowser inside Window frmBrowser? A link to a webinar which contain the solution will also do.

Thank you very much in advance.

Have a nice day.


drag the clssBrowser class to the window

Thank you very much for your reply which I appreciate. However dragging the clssBrowser control to the window is no option.

There can be one clssBrowser sub-class but there can be two or three dependent on the users choice. Every time a clssBrowser is added, the others will scale down so all 2 or 3 are visible in the same window.

Dragging custom controls to the window is how I do it normally, however now I have to show the clssBrowser completely in code. This is what I cannot find.

You have to have a control set to do what you’re describing, so you will have to have at least one instance on the window design time.

make this “control” a container control then you can use NEW and embed within and things will work

embedding a control the way you’re trying to wont

Hi Jean-Yves Pochez, Tim Parnell and Norman Palardy,

Thank you all very much for your replies and usefull information.

I followed the link given by Tim Parnell and found the solution to my answer. Before I posted here, I was already searching for more than an hour but kept running in circles.

You all made my day!