Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB 6.0 >>> VB.NET / September 2004

Tip: Looking for answers? Try searching our database.

WinForm MDI Child in VB6 MDI

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nieder - 18 Mar 2004 14:01 GMT
Hi

When migrating af huge windows system from VB6 to C#, it has to be done in small step
in order to be feasible

The system I'm working on is an MDI system in VB6. We would like to be able to migrate a few windows at a time
Thus we need to be able to make a WinForm an MDI child of a VB6 MDI form

It is easy enough to invoke the WinForm from VB6. This is done by COM enabling it, and providing public functions for starting it

When I want to make it an MDI child I get into servere trouble.

The best effort I have made so far makes use of WinAPI calls like thi

 lhwndParent = GetWindow(mdiFrm.hwnd, GW_CHILD
 SetParent lhwnd, lhwndParen
 SetWindowLong lhwnd, GWL_STYLE,
   ((GetWindowLong(lhwnd, GWL_STYLE) Or WS_CHILD Or WS_SYSMENU) And Not WS_POPUP

Were lhwnd is the handle to the WinForms window

And mdiFrm.hwnd is the handle to the VB6 MDI form

This makes the WinForm act like an MDI child

However som very important aspects are missing

1. When activating the MDI child the title bar is greyed (in reality only the VB6 MDI form is activated
2. The Child doesn't appear in the Windows list in the menu bar of the VB6 MDI
3. Tab keys and arrow keys doesn't work on the MDI child (this is the worst one in our system
4. When maximized the child doesn't "share" its titlebar with the MDI parent

So how can I make the WinForm a true MDI child of the VB6 application
If this is not possible then how do I fake this behaviour ? Any Ideas

(Hope this is the right newsgroup for posting this message

Regards nieder
DotNetJunkies User - 01 Jul 2004 13:43 GMT
Thanks for the useful post.

Do you have any more verbose sample source code to do this sort of thing?

I'm quite new to using winapi calls in VB and thus am getting a bit lost.

Regards,
J. Mercer

---
DotNetJunkies User - 23 Sep 2004 15:11 GMT
I am realy struggling to get you suggestion working. But not succeeded yet. Could you please pass on the exact source code?

Thanks in advance.
VH

---

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.