문제

I’m writing a little Windows application which has two list-view-controls. I have set it up so that the user can tab (focus) between the two, but I need a way of visually indicating which is the active control. I don’t want to go to the trouble of messing with owner-drawn controls, so I experimented with some of the different window styles like border and client edge, but none look good. I decided to toggle the disabled property because it looks best and is easy to use.

The problem now is that I have the controls set up so that whenever the user clicks on either one, it grabs the focus (calls SetFocus(), sets a handle to itself, etc.) but of course, disabled controls don’t get event notifications like mouse clicks.

Does anyone have a suggestion on how I can retain the visual distinction of the active control and also be able to toggle the active window with the mouse?

도움이 되었습니까?

해결책

Hans’ suggestion of using CTRLCOLOR reminded me of using that a long time ago to easily make some changes to the colors of controls which then reminded me of CustomDraw.

I decided to use CustomDraw to indicate the currently active control because it is even easier, and yet provides even better control.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top