I looked at the programmer’s reference and there was no mention of how to programmically resize two controls (For example two listboxes) in a window, where the one listbox you want to expand, and the other listbox you want to decrease. I looked at window.resize, but I do not think that is the way to do it. It would be nice to change the pointer to show that you can resize the controls, like two listboxes.
For runtime resizing of controls based on this type of user interaction, you need a splitter-type control that provides a handle for the mouse to grab and automatically does the resizing for you. I offer GraffitiSplitter and GraffitiActionBar for desktop, and there other alternatives out there.
I put a separator in the window and made it thin, but I guess that would not work to resize the two listboxes, unless I did not figure this out correctly. I guess there is no way to know if the left mouse button is depressed and your draging the control left or right. I do not think I figured this out correctly. Any help would be great.
Thanks! I tried it, it works if you do not set the window’s position or change the size of the window – or put the window on maximize. Is there a work-around to this problem with imsplitter?
I was looking at window event handler “Resizing”, I do not know what code I should put in there. I have two listboxes and the spliter on a window. All I did was put the code in the imsplitter’s open event… me.AddControl(Window2.Listbox1,False) and
me.AddControl(Window2.Listbox2,True). When I resize, the listboxes move away from each other and when the form is maximized, the listboxes are two to three hundred pixels from each other and only on the bottom half of the window.
I am going to change what sides of the window controls are locked in the ide, I wonder if that might fix the problem.
Solution: Changing the locking of the controls solved the problem I was having. Sorry to bother you about this, but I learned something. The IMsplitter is very nice, thank you!
Locking on all sides works fine for a single control. However, when several controls are placed on the window with this kind of locking, they simply collide when the window is enlarged.