Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi i've a dockable pane in my program with three child windows, a tab ctrl and two toolbox-like windows. since my program's window may be resized by user, the dockable pane should have vertical and horizontal scrollbars which have to get visible when required, so that the tools may be exposed if have got hidden. sorry if i couldn't describe better. in brief, a dockable pane or the two toolbox child windows inside it should have scrollbars. the two windows are not shown at the same time. they're toggled with the tab ctrl.
first, let me know which one is better? putting scrollbars for the toolbox windows or for the whole pane? i think it's better to put scrollbars for the toolbox windows, since if i put them for the whole pane, tab ctrl is also scrolled.
then, the problem is that when i click on the scrollbars it seems that the mouse messages are not received by the scrollbars and they're received by the pane itself instead. the pane responses to the mouse messages by getting undocked!
what i want as ideal is that:
- when a tool ctrl is clicked the tool ctrl window receives the click (now this happens)
- when a scrollbar is clicked the scrollbar receives the click (it's not the case now)
- when i click on the area of the toolbox which is outside of all tool ctrls the pane is undocked (it's the case)
i think i've to create scrollbar ctrls instead of enabling WS_VSCROLL and WS_HSCROLL styles of the pane or the toolbox ctrls.
please help me find how to go on.
thx
Posted

1 solution

You need to study the message and notification handling process for these controls. When a scrollbar is clicked or moved, it sends a notification message to its parent window, so that window needs to handle the message and repaint itself according to the direction and amount of scrolling. As to where you put the scrollbars, that depends on where you think is the best for visual style and user friendliness.
 
Share this answer
 
Comments
ilostmyid2 13-Jul-14 4:26am    
thanx, but my problem is before this. if a scrollbar receives mouse move or other mouse events like hover, etc. its appearance change, eg. its buttons at start and end and also the thumb button is repainted to show that they're ready to be clicked on or dragged. in my case, no such visual effects appear. it seems that they're not receiving mouse events and the pane instead receives them.
another pane in my program includes a property grid. its scrollbar has no problem. when i referred to its implementation, i saw that the scrollbar there is a separate ctrl. i think i've to use a separate ctrl for scrollbars and can't enable the toolbox ctrl's scrollbars for this purpose. why? i don't know. and i'm also not sure about this idea.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900