Click to See Complete Forum and Search --> : splitter windows


Samson
March 3rd, 1999, 04:12 AM
I´ve created a new vb5 project based on the explorer-like template.

After that i´ve deleted the treeview-control and used a listbox with the

same name. when i now drag the "line" between the two controls, its not

displayed while moving the mouse with button pressed to the left side.

When i move the mouse to the right side (listview control) the splitter pane

is display.

what´s wrong or what must i do ?

Ravi Kiran
March 18th, 1999, 02:57 AM
Hi,


I think the problem is with Z-Order. VB keeps track of the order in which controls are created, so that in the event that one were to come on top of other (except one of them is a container ) the control which was created later will be on top of the z-order.


I am assuming you are faking the splitter appearence with some other control.

(I have done a similar 3-view/2splitter code myself.)

Now since your List box was created later that your splitter control , it has higher precedence in z-order. Hence set z-oder of the splitter control, while dragging to vbBringtoFront, then at the end of dragging, BE SURE to set it

to vbSendtoback. If your splitter control is too thin, you may have problem of not recognising the mouse move on it, because it is now on the back of z-order.


Another simpler solution would be

1.remember the name of your splitter control including index, if any

2.Delete it

3.Create a new instance and name it as the old fellow. This will make sure that

the new instance has higher precedence than the listbox.


But your problem might persist when ever you happen to add controls again.

Soln.1 is a good idea.


Ravi Kiran