How to create a horizontal resizing splitter bar
First of all, in your form, you have to create 2 new controls :
imgSplitter (image) borderstyle=0 height=200
picSplitter (picture) visible=false height=120 backcolor=GREY
Here is an example with 2 listview controls (lvw1 and lvw2 in the same form) :
Private Sub Form_Resize()
If WindowState <> 1 Then SizeControls imgSplitter.Top
End Sub
Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
With imgSplitter
picSplitter.Move .Left, .Top, .Width - 20, .Height \ 2
End With
picSplitter.Visible = True
picSplitter.ZOrder
mbMoving = True
End Sub
Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim sglPos As Single
If mbMoving Then
sglPos = Y + imgSplitter.Top
If sglPos < sglSplitLimit Then
picSplitter.Top = sglSplitLimit
ElseIf sglPos > Me.Height - sglSplitLimit Then
picSplitter.Top = Me.Height - sglSplitLimit
Else
picSplitter.Top = sglPos
End If
End If
End Sub
Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
SizeControls picSplitter.Top
picSplitter.Visible = False
mbMoving = False
End Sub
Private Sub lvw1_DragDrop(Source As Control, X As Single, Y As Single)
If Source = imgSplitter Then SizeControls Y
End Sub
Public Sub SizeControls(Y As Single)
On Error Resume Next
If Y < 2000 Then Y = 2000
If Y > (MainForm.Height - 2000) Then Y = MainForm.Height - 2000
MainForm.lvw1.Height = Y - 500
MainForm.imgSplitter.Top = Y
MainForm.lvw2.Top = Y + 40
MainForm.lvw2.Height = MainForm.Height - 800 - MainForm.lvw1.Height - MainForm.tlBar.Height - MainForm.stBar.Height
End Sub
Good luck,
Thierry Demoy
(soory for my approximative english)