ITPOL
asked on
How do I stop the childform overlapping the menubar and statusbar when i use Setparent?
As a test app, I have a .net MDI parent form, with a standard menubar and statusbar. On the 'new' button click, I start a new process, get it's window handle using .MainWindowHandle, and pass it to SetParent, to make it a child of the main form. This works, however if I maximize the child window it overlaps the menubar and the statusbar. It also overlaps the menu/status bar when the form is moved around inside the client area.
Any ideas how i stop this? I only want it to expand into the main client area.
Many Thanks in advance
Any ideas how i stop this? I only want it to expand into the main client area.
Many Thanks in advance
Dim p As New Process
p.StartInfo.FileName = "notepad.exe"
p.Start()
Threading.Thread.Sleep(1000)
SetParent(p.MainWindowHandle(), Me.Handle)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this code will fill inthe MDI area and check to make sure that it is not running already in the background under someother screen.
This code will also kept the Maximized Child Forms from flickering when opening
Open in new window