-
April 14th, 2008, 04:26 AM
#1
How to create custom interop container controls
Hi,
I want to create my own custom control container in Vb.net 2008 to be used for vb6 application. Therefore, it should be an interop user control container which will be exposed to vb6 through interop tools. I am trying to create it but it behaves like a control not as a container.
How can I add a control to it at design time ?
What I have done, is to place a groupbox control on the usercontrol area.
The groupbox is named as ContainerArea while the usercontrol itself is named as unicodeframe. here's the code:
Code:
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Windows.Forms
<Designer("System.Windows.Forms.Design.ParentControlDesigner,System.Design", GetType(IDesigner))> _
<ComClass(UnicodeFrame.ClassId, UnicodeFrame.InterfaceId, UnicodeFrame.EventsId)> _
Public Class UnicodeFrame
Inherits UserControl
Implements System.ComponentModel.INestedContainer
Public Sub Add(ByVal component As System.ComponentModel.IComponent) Implements System.ComponentModel.IContainer.Add
Me.Container.Add(component)
End Sub
Public Sub Add(ByVal component As System.ComponentModel.IComponent, ByVal name As String) Implements System.ComponentModel.IContainer.Add
Me.Container.Add(component, name)
End Sub
Public ReadOnly Property Components1() As System.ComponentModel.ComponentCollection Implements System.ComponentModel.IContainer.Components
Get
Return Container.Components
End Get
End Property
Public Sub Remove(ByVal component As System.ComponentModel.IComponent) Implements System.ComponentModel.IContainer.Remove
Container.Remove(component)
End Sub
Public ReadOnly Property Owner() As System.ComponentModel.IComponent Implements System.ComponentModel.INestedContainer.Owner
Get
Return Me.ParentForm
End Get
End Property
The control works ok on the vb.net testform but it does not work on the vb6 form as a container.
Any help will be appreciated.
kind regards,
Nasir
Last edited by 2kaud; September 7th, 2017 at 05:48 AM.
-
April 15th, 2008, 09:39 AM
#2
Re: How to create custom interop container controls
-
September 7th, 2017, 05:05 AM
#3
Re: How to create custom interop container controls
Originally Posted by HanneSThEGreaT
[ Moved ]
Where was this moved too? I can't find it and have the same issue.
-
September 7th, 2017, 05:49 AM
#4
Re: How to create custom interop container controls
It was moved to here - but has had no further posts. Sorry.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
September 7th, 2017, 05:54 AM
#5
Re: How to create custom interop container controls
Originally Posted by 2kaud
It was moved to here - but has had no further posts. Sorry.
I see, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|