Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / February 2005

Tip: Looking for answers? Try searching our database.

Scrollbar of a CComboBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Seko - 27 Feb 2005 17:16 GMT
Hi,
I'd like to know if there's a way to subclass the scrollbar of a CComboBox
control?

Thanks in advance,
David
Jeff Partch [MVP] - 27 Feb 2005 17:35 GMT
> Hi,
> I'd like to know if there's a way to subclass the scrollbar of a CComboBox
> control?

No.
Signature

Jeff Partch [VC++ MVP]

Seko - 27 Feb 2005 18:10 GMT
Can you please explain, why not? :-(
Jeff Partch [MVP] - 27 Feb 2005 18:58 GMT
> Can you please explain, why not? :-(

Because a window scrollbar is not a window itself.
Signature

Jeff Partch [VC++ MVP]

Seko - 27 Feb 2005 22:17 GMT
Is there no way of making it a window?
It should have a handle, no?
Mike Martin - 27 Feb 2005 22:38 GMT
> Can you please explain, why not? :-(

Some scrollbars are windows and some are not.  If you create a window with
the WS_HSCROLL or WS_VSCROLL styles then that window gets "standard"
scrollbars that are not separate controls, they are just part of the
non-client portion of the window that contains them.  This is the case for a
combobox.
Seko - 28 Feb 2005 00:49 GMT
So, there's totally no way of accessing the scrollbars, and therefore no way
to perform any custom-drawing on them?
How are XP styles handled, giving those scrollbars a whole different look
than the standard, then?

"Mike Martin" <nobody@nowhere.com> wrote:
OtslH0RHFHA.3588@TK2MSFTNGP14.phx.gbl...
>> Can you please explain, why not? :-(
>
[quoted text clipped - 4 lines]
> a
> combobox.
Jonathan Wilson - 28 Feb 2005 01:44 GMT
> So, there's totally no way of accessing the scrollbars, and therefore no way
> to perform any custom-drawing on them?
> How are XP styles handled, giving those scrollbars a whole different look
> than the standard, then?
It is handled by (I think) the WM_NCPAINT code for the listbox window that
goes with the combo box.
Serge Baltic - 28 Feb 2005 11:20 GMT
>> So, there's totally no way of accessing the scrollbars, and therefore
>> no way to perform any custom-drawing on them?

There is. Catch combobox's WM_NCPAINT and play with it as you wish.

>> How are XP styles handled, giving those scrollbars a whole different
>> look than the standard, then?
JW> It is handled by (I think) the WM_NCPAINT code for the listbox
JW> window that goes with the combo box.

Rather by DefWindowProc, I think.

Signature

Serge


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.