Results 1 to 1 of 1

Thread: VB6 - In-Form Splitter Bars

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Angry VB6 - In-Form Splitter Bars

    Yes, there are a ton of splitter bar/splitter box UserControls out there. I've written a few myself.

    But I recently discovered that the Tablet PC Platform controls (in particular the InkEdit control) have some serious flaws when they are not direct "children" of a Form. If you put one in a UserControl they don't accept "ink" and they capture the Tab key, breaking your Form's tab-order (as soon as the encapsulted InkEdit gets focus you can't tab out of it).

    So I went into one of my splitter projects and dug out the important logic. Then I put that logic directly into a Form and tweaked it to "live" there.

    Basically there is a PictureBox (the "bar" itself) to paste into your Form, and a blob of declarations to add, and a blob of logic to add. After that you must call SplitterInit in Form_load, call SplitterPanesResize in Form_Resize, and tweak SplitterPosition to reflect your other controls to be positioned within the two "panes" left and right of the splitter bar.

    There are some constants you can tweak for the splitter bar width, etc.


    If you want a splitter for top/bottom panes you can adjust the code for that pretty easily. However unlike with a splitter UserControl it gets complicated to nest splitters (i.e. have a left and right pane with top and bottom panes within the right pane).

    But at least your Form will still work properly if you're using InkEdit controls.

    And this can serve as sample code somewhat simpler than many other posted examples of making splitters.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width