Steve Loughran wrote:
mmmm... Another function that states it works on a window, but can also
work on objects... you would think by now I would have learned a lesson
about this, what with my Sort()<-->Treeview issue over the weekend, but
apparently not :)
Right, edited code to SetFocus and it works a treat... thanks for that :)
You might do better to add the TVS_SHOWSELALWAYS(value=32) style - which
results in the selection always being highlighted, rather than only when
the control has focus. This will stop the selected item flickering
while the focus moves between the tree view and the button and back, and
will also let you leave the focus where the user expects it to be.
Is scrollbar "fatness" a system wide setting?
Yes. It can be set from:
Control Panel -> Display -> Appearance tab
In the Item dropdown select 'scrollbar', and then use the Size box to
set the width/height. This will affect nearly all scrollbars in every
application.
You can retrieve the values programatically using the GetSystemMetrics
API, passing in either SM_CXVSCROLL to get the width of a vertical
scrollbar or SM_CYHSCROLL to get the height of horizontal scrollbar.
If you want to control the size of the scroll bar without changing the
system sizes, then you can't use the 'system scroll bar' provided by the
-vscroll and -hscroll options to the control: you'll need to use the
scrollbar class to generate your own scrollbar, position and size it
yourself, and process the messages from it to re-position the treeview
control - I've never tried this, so I can't provide any examples.
Regards,
Rob.