Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Subclassing the Horizontal scroll-bar of a CListCtrl

Posted on 2002-06-27
9
Medium Priority
?
529 Views
Last Modified: 2013-11-20
Hi,
I need to replace the horizontal scroll-bar of a CListCtrl in a horizontal scroll bar of my own (I need a different behaviour from the normal).
I tried to place a CControlBar control exactly in the position of the default control-bar but it does not work because every time the default control-bar pops up, it pop in front of my control-bar.
I think that what I need to do is somehow to block the setting of WS_HSCROLL style (which is set every time that the control can scroll and disappear whenever scrolling can not be done).
Can someone tell me how can I block the poping of the default Horizontal scroll-bar ?

Thanks,
Yoav.
0
Comment
Question by:yoavo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:gurly
ID: 7113808
Maybe CWnd::EnableScrollBarCtrl(SB_HORZ, FALSE) can help you ?
0
 

Author Comment

by:yoavo
ID: 7113838
I tried it but the default scroll-bar keeps coming...
0
 
LVL 1

Expert Comment

by:gurly
ID: 7113941
If you can catch the message that cause the scrollbar to be created, maybe you can than cal GetScrollBar and destroy it ?
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

Expert Comment

by:spanasik
ID: 7139563
You must subclass your window(CListCtrl).
Try to read at www.codeproject.com great article from Chris Maunder "Create your own controls - the art of subclassing".
http://www.codeproject.com/miscctrl/subclassdemo.asp
IMHO this is a right way.
I don't include any code, because i don't subclass any CListCtrl in my projects, but in given article Chris subclass a button and explain in detail whole process.
Hope this help you !

Stas.
0
 

Author Comment

by:yoavo
ID: 7139704
This answer is too general. I know what subclassing is...
0
 
LVL 4

Expert Comment

by:mblat
ID: 7170319
I am wondering....

If you need different from default behaivour for horizontal scrool bar why can't you handle WM_HSCROLL the way you want, without calling default implementation?


Or you need different apperance also, not just behaviour?
0
 

Author Comment

by:yoavo
ID: 7171084
need different apperance also...
0
 
LVL 4

Expert Comment

by:mblat
ID: 7172116
Of cause one way to do that would be to impelement owner draw list ctrl. There are some samples of it on codeguru.com.  

Since it is not exactly what you wanted let me see if I can come up with something else....
0
 
LVL 4

Accepted Solution

by:
mblat earned 300 total points
ID: 7172350
Problem here is that scroll bar in list view isn't scroll bar at all. :-(
It is just painted area inside the control that behave like scroll bar.
My guess would be that it comes from Win3.1 days when it was too expensive to create 2 extra controls.

So unless you go owner-draw route I don't think you can do what you want. :-(
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question