You would need to use 4 more forms.
Set the border style to the 4 forms to
0 - None.
In code, we'll make each of the 4 forms half the height and width of the form you want to make look like has been split (i.e. so if you put them all together in a rectangle, it's the same size as that form), so don't worry about their size. Make a PictureBox in each of the 4 forms, with Top-Left position at 0,0. In code, we'll set their size to fill the forms fully.
For each of the 4 PictureBoxes
and each of the forms which they are on, set each of their
ScaleMode properties to
3 - Pixel. Also set each of their
AutoRefresh properties to True.
Then you'll need to use this
Bit-Block Transfer ('Blitting') Module to copy the graphics - i.e. whatever is being shown on the main form - in 4 goes onto each of the 4 forms. For example, if the main form is 400x800, you'd need to copy in 4 goes of 100x200, with the top-left position at:
0,0 (Top-left of form into the first of the 4 small forms)
100,0 (Top-right of form into the second of the 4 small forms)
0,100 (Bottom-left of form into the third of the 4 small forms)
100,100 (Bottom-right of form into the last of the 4 small forms)
-
Public Declare Function BitBlt Lib "GDI32" _
-
(ByVal hDestDC As Long, _
-
ByVal X As Long, ByVal Y As Long, _
-
ByVal nWidth As Long, ByVal nHeight As Long, _
-
ByVal hSrcDC As Long, _
-
ByVal xSrc As Long, ByVal ySrc As Long, _
-
ByVal dwRop As Long) As Long
-
The blitting module copies rectangles of graphics from objects (we'll use the main form) to other objects (we'll use each of the pictureboxes in the 4 quarter-size forms).
hSrcDC = The hDC of the object it's copying from (original).
hDestDC = The hDC of the object it's copying
to (copy).
X,Y = The x and y position which the top-left of the copied rectangle will be placed at in the destination object.
nWidth, nHeight - The width and height of the rectangle which it will copy.
xSrc,ySrc = The x and y position of the top-left of the area which it will copy in the original object.
dwRop = The way in which it copies the graphics. We'll always use vbSrcCopy.
Call each of the 4 small forms
frmSplitTL (top-left), frmSplitTR (top-right), frmSplitBL (bottom-left), frmSplitBR (bottom-right)
Call each of their PictureBoxes picSplitTL, picSplitTR, etc, to match with the forms which they are on.
I'm imagining that your main form which you're wanting to look like is being split, is called MainForm, so change the code below to match what your form's called.
Call this code while MainForm is being shown.
-
'Get the forms to load but just make them invisible:
-
frmSplitTL.Show : frmSplitTL.Visible=False
-
frmSplitTR.Show : frmSplitTR.Visible=False
-
frmSplitBL.Show : frmSplitBL.Visible=False
-
frmSplitBR.Show : frmSplitBR.Visible=False
-
-
'Set their positions (Left and Top) to be over the top of MainForm, in TL/TR/BL/BR positions:
-
frmSplitTL.Left = MainForm.Left
-
frmSplitTL.Left = MainForm.Top
-
frmSplitTR.Left = MainForm.Left + (MainForm.Width / 2)
-
frmSplitTR.Top = MainForm.Top
-
frmSplitBL.Left = MainForm.Left
-
frmSplitBL.Left = MainForm.Top + (MainForm.Height / 2)
-
frmSplitBR.Left = MainForm.Left + (MainForm.Width / 2)
-
frmSplitBR.Left = MainForm.Top + (MainForm.Height / 2)
-
-
'Set the size of the 4 forms and their pictureboxes to be quarter of the size of MainForm:
-
Width:
-
frmSplitTL.Width = MainForm.Width/2 : frmSplitTL.picSplitTL.Width = MainForm.Width/2
-
frmSplitTR.Width = MainForm.Width/2 : frmSplitTR.picSplitTR.Width = MainForm.Width/2
-
frmSplitBL.Width = MainForm.Width/2 : frmSplitBL.picSplitBL.Width = MainForm.Width/2
-
frmSplitBR.Width = MainForm.Width/2 : frmSplitBR.picSplitBR.Width = MainForm.Width/2
-
Height:
-
frmSplitTL.Height = MainForm.Height/2 : frmSplitTL.picSplitTL.Height = MainForm.Height/2
-
frmSplitTR.Height = MainForm.Height/2 : frmSplitTR.picSplitTR.Height = MainForm.Height/2
-
frmSplitBL.Height = MainForm.Height/2 : frmSplitBL.picSplitBL.Height = MainForm.Height/2
-
frmSplitBR.Height = MainForm.Height/2 : frmSplitBR.picSplitBR.Height = MainForm.Height/2
-
-
-
'Copy top-left part of form to top-left PictureBox:
-
BitBlt frmSplitTL.picSpiltTL.hDC, _
-
frmSplitTL.picSplitTL.ScaleWidth, frmSplitTL.picSplitTL.ScaleHeight, _
-
frmSplitTL.ScaleWidth, frmSplitTL.ScaleHeight, _
-
MainForm.hDC, 0, 0, _
-
vbSrcCopy
-
frmSplitTL.picSplitTL.Refresh
-
-
'Copying top-right:
-
BitBlt frmSplitTR.picSpiltTR.hDC, _
-
frmSplitTR.picSplitTR.ScaleWidth, frmSplitTR.picSplitTR.ScaleHeight, _
-
frmSplitTR.ScaleWidth, frmSplitTR.ScaleHeight, _
-
MainForm.hDC, (frmSplitTR.ScaleWidth / 2), 0, _
-
vbSrcCopy
-
frmSplitBL.picSplitTR.Refresh
-
-
'Bottom-left:
-
BitBlt frmSplitBL.picSpiltBL.hDC, _
-
frmSplitBL.picSplitBL.ScaleWidth, frmSplitBL.picSplitBL.ScaleHeight, _
-
frmSplitBL.ScaleWidth, frmSplitBL.ScaleHeight, _
-
MainForm.hDC, 0, (frmSplitBL.ScaleHeight / 2), _
-
vbSrcCopy
-
frmSplitBL.picSplitBL.Refresh
-
-
'Bottom-right:
-
BitBlt frmSplitTR.picSpiltTR.hDC, _
-
frmSplitBR.picSplitBR.ScaleWidth, frmSplitBR.picSplitBR.ScaleHeight, _
-
frmSplitTR.ScaleWidth, frmSplitTR.ScaleHeight, _
-
MainForm.hDC, (frmSplitBR.ScaleWidth / 2), (frmSplitBR.ScaleHeight / 2), _
-
vbSrcCopy
-
frmSplitBR.picSplitBR.Refresh
-
-
-
'Now each of the picboxes should each have a quarter of MainForm's graphics in them, and the 4 forms have no borders, so if we make them visible and hide MainForm, it should look the same.
-
'So, we're gonna do that.
-
'Hide MainForm:
-
MainForm.Visible = False
-
'Show 4 quarter forms:
-
frmSplitTL.Visible = True
-
frmSplitTR.Visible = True
-
frmSplitBL.Visible = True
-
frmSplitBR.Visible = True
-
Now you can move each of those 4 quarters by themselves by changing their Top and Left values.
It may not be obvious at first that it is split; also, you can't move them because they have no border. If it looks the same, and to be able to move them, you can prove that it has been split by setting all 4 of the forms' BorderStyle properties to
1 - Fixed Single, before you run it again. Now it will be annoyingly obvious that they are separate. ;)
I hope it works. I haven't tested that, I just made it up. Please let me know what happens.