Important alert: (current site time 7/16/2013 3:51:23 AM EDT)
 

winzip icon

A Splitter Control

Email
Submitted on: 2/3/2000
By: Mark Joyal 
Level: Intermediate
User Rating: By 17 Users
Compatibility: VB 5.0, VB 6.0
Views: 36347
 
     This is a splitter control with 2 panes. I found the initial code out on the web somewhere, but it had a few bugs and was missing a few features I wanted, so I added the ability to colorize the splitter bar and the code now fires an event when the splitter is resized to allow for controls within controls to handle a resize. I also cleaned up the code and fixed a few bugs. BTW : You can add splitters within splitters to create more than just 2 panes.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
2/3/2000 11:27:58 AMCarl Pinto

this is great I was looking for something to do this!
(If this comment was disrespectful, please report it.)

 
4/15/2000 7:07:39 AMcris

How can i use it to split a form and make 2 controls, listview and textbox, resize height in the way windows explorer does, but in the other direction?
(If this comment was disrespectful, please report it.)

 
5/14/2000 9:28:22 AMEric Tomlinson

Can you give some idea on how to set it up for use? I'm a novice and can't get it to split correctly. Tried inserting controls into it etc. HELP!!!
(If this comment was disrespectful, please report it.)

 
5/15/2000 9:37:54 AMPhace

No documentation. How do you use it? I see two child objects, how do they work. This would be a nice piece if there was even some small documentation. I mean there's not even a sample application using this control!
(If this comment was disrespectful, please report it.)

 
5/25/2000 4:47:13 AMjohn

Definitely needs some documentation. A quick and dirty sample app with some comments on usage would be sufficient.
(If this comment was disrespectful, please report it.)

 
7/4/2000 3:39:26 PMElco

jeah I can't get this thing to work.. some comments in the source that's all no docs whatsoever :(
(If this comment was disrespectful, please report it.)

 
7/4/2000 4:31:03 PMauthor

dear god people, this isnt brain science. it doesnt get too much easier than this.
(If this comment was disrespectful, please report it.)

 
7/4/2000 4:32:00 PMMark Joyal

okay, my reply got truncated so try#2
1) drop splitter control on form
2) drop controls to split onto splitter container
3) set splitter.child1 = control_to_split_1
4) set splitter.child2 = control_to_split_2
5) run

jeez, it doesnt get much easier unless you want to pay big money to sheridan software.

(If this comment was disrespectful, please report it.)

 
8/14/2000 10:26:53 AMRich

Is there anyway to make a child2 a Form?
(If this comment was disrespectful, please report it.)

 
12/16/2000 4:07:18 AMyvikram


this is a great stuff. but i need to know how fixed length columns can be imported as such in ms excell or in dts wizard in MS-Sql...ie., splitting the columns
(If this comment was disrespectful, please report it.)

 
3/29/2001 1:08:23 PMDave

Brilliant! 5 stars.
(If this comment was disrespectful, please report it.)

 
8/10/2001 1:58:48 PMkcain

I am having trouble resizing the control in the my forms resize sub, if there are any splitter1.width = ? or .height changes it doesnt work, the form tries to resize but wont work
(If this comment was disrespectful, please report it.)

 
9/4/2001 3:18:45 AMJoo-Haeng Lee (aka Lixter)

Combination of vertical and horizontal bars (3 areas) works so easily. *****
Option Explicit

Private Sub Form_Load()
Splitter1.Orientation = splitVertical
Splitter1.SplitPercent = 50
Set Splitter1.Child1 = TreeView1
Set Splitter1.Child2 = Splitter2

Splitter2.Orientation = splitHorizontal
Set Splitter2.Child1 = ListView1
Set Splitter2.Child2 = Text1
End Sub

Private Sub Form_Resize()
Me.Splitter1.Height = Me.ScaleHeight - 2 * Me.Splitter1.Top
Me.Splitter1.Width = Me.ScaleWidth
End Sub
(If this comment was disrespectful, please report it.)

 
5/17/2002 7:29:27 AMDan F

Excellent piece of code.
(If this comment was disrespectful, please report it.)

 
6/25/2002 4:13:50 PMAndrew Saturn

kcain: divide the width and height by 15, then go from there :]

it seems the control forces TWIP maybe?...

heres what I used (but I have a weird form)

Splitter1.Width = (Me.Width / 15) - (Splitter1.Left + 8)
Splitter1.Height = (Me.Height / 15) - (Splitter1.Top + 8)


sorry of this reply is wayyy too late
(If this comment was disrespectful, please report it.)

 
1/30/2003 7:54:38 PMRay Ward

nice work!
exactly what i was looking for.
(If this comment was disrespectful, please report it.)

 
2/3/2004 5:08:50 PM

This is the most amazing freeware ocx I have used in my life!!! Period. Hats off to you Sir Joyal!
(If this comment was disrespectful, please report it.)

 
4/30/2005 4:29:50 PMdcroft

oh yeah.... very very nice.
(If this comment was disrespectful, please report it.)

 
10/9/2006 1:33:56 AMace

woah, and this is free. nice job!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.