Listview..... 
Author Message
 Listview.....

How do I stop the horizontal scroll bar appearing on a listview control in a
C# winform, I can manage to get the windows style and set the windows style
using win32 API calls (GetWindowLong, SetWindowLong, SetWindowPos) but the
horizontal scroll bar is automatically readded by the system....

So what is the message I need to filter out to prevent a horizontal scroll
bar appearing on the listview control?

I know there is a property to disable both scroll bars but I do not want to
do this, I have also had spy++ on the window but am unable to determine
which message changes the window style back to include the WM_HSCROLL -
please help ;)

Cheers in Advance

Ollie



Tue, 18 Oct 2005 00:30:43 GMT  
 Listview.....
Ollie,
   The scrollbars are created based on the WindowStyle not a message. Check
for the WS_HSCROLL in the window style.
Pete

Quote:
> How do I stop the horizontal scroll bar appearing on a listview control in
a
> C# winform, I can manage to get the windows style and set the windows
style
> using win32 API calls (GetWindowLong, SetWindowLong, SetWindowPos) but the
> horizontal scroll bar is automatically readded by the system....

> So what is the message I need to filter out to prevent a horizontal scroll
> bar appearing on the listview control?

> I know there is a property to disable both scroll bars but I do not want
to
> do this, I have also had spy++ on the window but am unable to determine
> which message changes the window style back to include the WM_HSCROLL -
> please help ;)

> Cheers in Advance

> Ollie



Tue, 18 Oct 2005 00:58:20 GMT  
 Listview.....
Cheers Pete, nut if you read my post i have already done this

I request they be removed but the system adds them back again!!!!!!

Ollie


Quote:
> Ollie,
>    The scrollbars are created based on the WindowStyle not a message.
Check
> for the WS_HSCROLL in the window style.
> Pete


> > How do I stop the horizontal scroll bar appearing on a listview control
in
> a
> > C# winform, I can manage to get the windows style and set the windows
> style
> > using win32 API calls (GetWindowLong, SetWindowLong, SetWindowPos) but
the
> > horizontal scroll bar is automatically readded by the system....

> > So what is the message I need to filter out to prevent a horizontal
scroll
> > bar appearing on the listview control?

> > I know there is a property to disable both scroll bars but I do not want
> to
> > do this, I have also had spy++ on the window but am unable to determine
> > which message changes the window style back to include the WM_HSCROLL -
> > please help ;)

> > Cheers in Advance

> > Ollie



Tue, 18 Oct 2005 00:58:42 GMT  
 Listview.....
Duh, sorry.... I skipped ahead to the message intercepting part...

My guess is that since you have wrapping off (I assume you have wrapping
off), every time it does a repaint, it's checking to see if a scrollbar is
needed.

So, I'm not sure how you could prevent that short of a couple of really
kludgy methods:

1: Check the width of the lines and trim the text as needed to keep it from
wrapping or creating the scrollbar
2: Create an ActiveX control that does an owner draw listview and then use
that in C#.

Pete

Quote:
> Cheers Pete, nut if you read my post i have already done this

> I request they be removed but the system adds them back again!!!!!!

> Ollie



> > Ollie,
> >    The scrollbars are created based on the WindowStyle not a message.
> Check
> > for the WS_HSCROLL in the window style.
> > Pete


> > > How do I stop the horizontal scroll bar appearing on a listview
control
> in
> > a
> > > C# winform, I can manage to get the windows style and set the windows
> > style
> > > using win32 API calls (GetWindowLong, SetWindowLong, SetWindowPos) but
> the
> > > horizontal scroll bar is automatically readded by the system....

> > > So what is the message I need to filter out to prevent a horizontal
> scroll
> > > bar appearing on the listview control?

> > > I know there is a property to disable both scroll bars but I do not
want
> > to
> > > do this, I have also had spy++ on the window but am unable to
determine
> > > which message changes the window style back to include the
WM_HSCROLL -
> > > please help ;)

> > > Cheers in Advance

> > > Ollie



Tue, 18 Oct 2005 01:10:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ListView Items: Can they be Editable?

2. Listview sort order status icon

3. Combobox over listview cell?

4. FW 1.0 SP3 - ListView empty lines

5. color of checkbox in the listview

6. ListView / Scrolled

7. Scrolling to a certain row with a listview

8. ListView Scrolling

9. stay at end of listview ??

10. Question about ListView

11. Adding columns to ListView after it's been added to a form

12. How to hide/Disable a Column in ListView control C#

 

 
Powered by phpBB® Forum Software