Divide screen

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
6 posts Page 1 of 1
Contributors
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Divide screen
AnoPem
Hello, i want to create a program where i can divide 1 screen into 4 smaller screens, but i have no idea where to start and how i could do it, can anyone give me some directions or anything to get me moving ?
https://t.me/pump_upp
User avatar
Shim
VIP - Donator
VIP - Donator
Posts: 882
Joined: Wed Dec 14, 2011 5:02 am

Re: Divide screen
Shim
Find my programs on Softpedia
User avatar
noypikami
VIP - Donator
VIP - Donator
Posts: 151
Joined: Sat Dec 22, 2012 1:49 am

Re: Divide screen
noypikami
create a boardless form. then put 4 panels and a buttons if you want.
you can add controls at runtime to make it more difficult to code, LOLzzz ;)

put this code below 'public class form1
Code: Select all
Public Class Form1
    Declare Auto Function SetParent Lib "user32.dll" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer
    Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
    Private Const WM_SYSCOMMAND As Integer = 274
    Private Const SC_MAXIMIZE As Integer = 61488
    Dim pro As Process

in each button put this code. you can do it using drag option and create panels at runtime
Code: Select all
pro = Process.Start("winword")
        pro.WaitForInputIdle()
        SetParent(pro.MainWindowHandle, me.panel1.Handle)
        SendMessage(pro.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
        
====change the to pro=Process.Start("C:\WINDOWS\notepad.exe") if you want to open notepad in your panel inside form

===== hope this helps.=========
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: Divide screen
AnoPem
#noypikami is this a way of creating child forms ?

unfortunatly this is not working as i want, it will open most programs in its own window
https://t.me/pump_upp
User avatar
noypikami
VIP - Donator
VIP - Donator
Posts: 151
Joined: Sat Dec 22, 2012 1:49 am

Re: Divide screen
noypikami
it's not a child form.. it opens a program inside a form/ inside a panel. the code works in multiple programs and can be viewed inside a single form not on its own window..
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: Divide screen
AnoPem
noypikami wrote:
it's not a child form.. it opens a program inside a form/ inside a panel. the code works in multiple programs and can be viewed inside a single form not on its own window..
The only program that i could get to open inside the actual form was notepad
https://t.me/pump_upp
6 posts Page 1 of 1
Return to “Coding Help & Support”