PC Review


Reply
Thread Tools Rate Thread

Placing a .NET Form/UserControl inside a VB Form

 
 
Jim
Guest
Posts: n/a
 
      21st Mar 2005
Hi Group.

I'm trying to place my own windows form or user control inside a VB Form.

My first attempt used the IOleWindow::GetWindow of the VB Form in order
to get its handle. I then used Win32 API SetParent to place my .NET Form
inside the VB Form.

Now the problem is that neither tab stops or accelerator keys work using
this approach :/

Does anyone have a solution to this problem, or alternative ways of
placing my .NET Forms inside the VB Form???

For reference, the VB Form implements the following interfaces that
could provide a solution:

{00000000-0000-0000-C000-000000000046}: IUnknown
{00000019-0000-0000-C000-000000000046}: IExternalConnection
{0000010a-0000-0000-C000-000000000046}: IPersistStorage
{0000010c-0000-0000-C000-000000000046}: IPersist
{0000010d-0000-0000-C000-000000000046}: IViewObject
{0000010e-0000-0000-C000-000000000046}: IDataObject
{00000112-0000-0000-C000-000000000046}: IOleObject
{00000113-0000-0000-C000-000000000046}: IOleInPlaceObject
{00000114-0000-0000-C000-000000000046}: IOleWindow
{00000117-0000-0000-C000-000000000046}: IOleInPlaceActiveObject
{0000011a-0000-0000-C000-000000000046}: IParseDisplayName
{0000011b-0000-0000-C000-000000000046}: IOleContainer
{0000011c-0000-0000-C000-000000000046}: IOleItemContainer
{0000011e-0000-0000-C000-000000000046}: IOleCache
{00000126-0000-0000-C000-000000000046}: IRunnableObject
{00000127-0000-0000-C000-000000000046}: IViewObject2
{00000128-0000-0000-C000-000000000046}: IOleCache2
{00020400-0000-0000-C000-000000000046}: IDispatch
{04598FC8-866C-11CF-AB7C-00AA00C08FCF}: _UserForm
{376BD3AA-3845-101B-84ED-08002B2EC713}: IPerPropertyBrowsing
{55980BA0-35AA-11CF-B671-00AA004CD6D8}: IPointerInactive
{618736E0-3C3D-11CF-810C-00AA00389B71}: IAccessible
{6D5140C1-7436-11CE-8034-00AA006009FA}: IServiceProvider
{9BFBBC02-EFF1-101A-84ED-00AA00341D07}: IPropertyNotifySink
{B196B283-BAB4-101A-B69C-00AA00341D07}: IProvideClassInfo
{B196B284-BAB4-101A-B69C-00AA00341D07}: IConnectionPointContainer
{B196B288-BAB4-101A-B69C-00AA00341D07}: IOleControl
{B722BCC5-4E68-101B-A2BC-00AA00404770}: IOleDocument
{B722BCC6-4E68-101B-A2BC-00AA00404770}: IOleDocumentView
{B722BCCB-4E68-101B-A2BC-00AA00404770}: IOleCommandTarget
{CF51ED10-62FE-11CF-BF86-00A0C9034836}: IQuickActivate
{DF0B3D60-548F-101B-8E65-08002B2BD119}: ISupportErrorInfo
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      21st Mar 2005
Jim,

"Jim" <(E-Mail Removed)> schrieb:
> I'm trying to place my own windows form or user control inside a VB Form.
>
> My first attempt used the IOleWindow::GetWindow of the VB Form in order
> to get its handle. I then used Win32 API SetParent to place my .NET Form
> inside the VB Form.


Using a VB6 form as host for a Windows Forms control is not supported:

ActiveX control containers that support .NET controls
<URL:http://support.microsoft.com/?scid=kb;EN-US;311334>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      21st Mar 2005
So the potential solution would be to use a web browser control on a VB6
userform and use the browser to host the .Net Windows form or control?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Jim,
>
> "Jim" <(E-Mail Removed)> schrieb:
>> I'm trying to place my own windows form or user control inside a VB Form.
>>
>> My first attempt used the IOleWindow::GetWindow of the VB Form in order
>> to get its handle. I then used Win32 API SetParent to place my .NET Form
>> inside the VB Form.

>
> Using a VB6 form as host for a Windows Forms control is not supported:
>
> ActiveX control containers that support .NET controls
> <URL:http://support.microsoft.com/?scid=kb;EN-US;311334>
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      21st Mar 2005
Sue,

"Sue Mosher [MVP-Outlook]" <(E-Mail Removed)> schrieb:
> So the potential solution would be to use a web browser control on a VB6
> userform and use the browser to host the .Net Windows form or control?


That will be a supported scenario.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PLACING A PIC INSIDE A CALENDAR APPT JL Microsoft Outlook Calendar 5 17th Dec 2008 05:09 PM
appear or add more form inside form , or inserting more textfield inside form wazza w via AccessMonster.com Microsoft Access Form Coding 7 7th Sep 2005 05:54 AM
Placing a form inside of a form pjw Microsoft Excel Programming 4 17th Jun 2005 07:08 AM
Placing form class inside Namespace Simon Jefferies Microsoft VC .NET 1 19th Jul 2004 05:32 PM
Make a hyperlink, by placing data in a cell inside 0o0o0 Microsoft Excel Programming 2 12th Oct 2003 08:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:52 PM.