How can I create a split bar control (label control) to resize parts of a form?

  • Thread starter Thread starter Savvoulidis Iordanis
  • Start date Start date
You can use the resize event of a form to dynamically move/size controls.

On my website you will find a demo of a form resizing solution (see under
products). You can download the demo and set the moving/sizing factors of
the controls to experiment with how this works. This solution has been
packaged up into an Access class module (no third party controls required)
and allows you to specify which controls should move/grow and by how much as
your form is resized, restored or maximised. A (very small) fee is required
for the source code.
 
Well, I really meant a split bar control, like the one that separates the
folders from the files in Windows explorer.

Has anyone implemented that?
 
Sorry I misunderstood your requirement (when you have a hammer every problem
looks like a nail).

I believe that Sheriden do a split bar control for VB though I don't know
how compatible it is with Access (or what the cost for the current version
is).

I guess you could have a go at coding one yourself by using a control (say a
label) as the split, and using the mouseover event to change the cursor and
the mousedown and mouseup to figure out where the control has been dragged
to (and then resize the controls to the left and right of the split
accordingly). I think you would have trouble though showing the split
actually moving.

One thought would be to control the split with a slider control. Not ideal,
but I believe you could update the screen while the slider is dragged.
 
Thanks for the reply.
Well, I am already on this path, but first let me analyze the problem of
coding this, a bit.

The form (unbound) has a subform in the detail and a subform and some other
controls in the footer.
The problem is where (and how) to code the mousemove event. In the outer
form? In the detail? In the split label itself? In the footer?
Whichever I choose, the mouse will sometime pass over the subforms, which
swallow the event themselves, so the detail/footer mousemove events stop
occuring.
I believe I'm going to need some API (which I personally hate mixing for
this kind of coding), so if anybody can help I'm all ears(I mean eyes)

TIA
 
Hi,

You could use the picture control and the mousedown event when you do a
drag. You will have to size both windows. In the event, you will have to call
the screen.repaint method for each mousemovement.
 
I haven't used it myself, but FMS do a splitter control as part of their
Total Access Components package ...

http://www.fmsinc.com/products/components/index.html

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
What about the subforms above and below the split? They swallow the
mousemove event.

Also, in which event could I get the position of the mouse inside the main
form? The splitbar mousemove? The main detail mousemove? The main form's
mousemove?

TIA
 
Back
Top