About ListView Again

  • Thread starter Thread starter Menu Chen
  • Start date Start date
M

Menu Chen

First I feel very sorry that my English is very poor.So
Please Don't be boring.

I have asked this question here once ,but no one could
give me answer,and the problem still bothers me.

I use a ListView Control in my programs.You know that we
always need a scroll bar in this contorl.But All I need is
the vertical scroll bar.I don't want the control display
horizontal scroll bar to Users,but how to do this?
Or ,if someone can help me to prevent the Users from
Resizing the width of the columns,it will be OK,too.


If you wish to help me,please write down your text in
simple English ,Thank you very much.
Best Regards. Menu Chen
 
i didn't test this but normally you can set the vertical scroll bar to true
and the horizontal scrollbar to false
to prvent users from resizing you can have a look at the resizing property

hope it helps

eric
 
Hi Menu Chen,

When you look in the documentation from the listview and you go for columns
the reference is always for to the columnheader. I never could find any
documentation for the columns from a listview other than the columnheader. I
never tried it, but there exist also listview1.columns(n).width.

I saw that you know enough of VB.net in the other threads from this
newsgroup to try it for yourself if this can do something for you.

And you don't have to excuse yourself for your English. I think it is more
than good enough to communicate in this International newsgroup.

Welcome to this newsgroup

Cor
 
* "Menu Chen said:
I use a ListView Control in my programs.You know that we
always need a scroll bar in this contorl.But All I need is
the vertical scroll bar.I don't want the control display
horizontal scroll bar to Users,but how to do this?

On my computer the horizontal scrollbar is only visible if there are
items outside the horizontal visible area.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Hi Herfried,

On my computer the horizontal scrollbar is only visible if there are
items outside the horizontal visible area.


When you have problems with that, you can use the solution that Menu Chen
did give you.

I hope this helps a little bit,

Cor
 
Herfried,
Chen did knew that already, (you deleted the quote about that I did send
you)

Are you telling what weather it is in Wien also in this newsgroup?

:-)

Cor
 
Herfried,

The sun is shining here,
Or ,if someone can help me to prevent the Users from
Resizing the width of the columns,it will be

Why did you think he wrote that?

Because he did not know that the scroll bar was there when the columns
became to width?

Cor
 
I saw you writed to Herfried to say that I have got the
answer of my own question .But ,I am sorry to say that I
still don't know how to slove that problem.
As you say ,yes I can control the width of a comblum.But
that is not all.Cause the User of my programs always
change the widths manualy,and this will cause the
horizontal scroll bar to be shown.In other words,if there
were some solution can prevent the Users from modifying
the widths manualy,it would be Ok either.
Thanks a lot for helping me .
Best Regards
 
Hi Menu,

Herfried was not given you an answer, he said that the horizontal scroll bar
came visible when the columns became to wide to fit on the screen. I said
that is what Menu knows already.

I thought you understand it, when you can control the size of the columns
and you did ask that (I am not absolute sure of it works), you can on a
click and all other events from the user always put it back to the right
size. It looks maybe as elastic but the user get it never wider.

I hope I did make it clearer?

Cor
 
I see ,and I have tried your method before.
But ,I found that resize the width of the column was not
any type of events of ListView controls.And it seems that
this resizing event didn't belong to anyting.Even if I use
Spy++ I cann't recognize its event either.
Woulud you test it for me,thanks .
Best Regards.
 
Hi Menu,

I never said it was nice.

And I cannot find an event that is fired when the mouse is in the column
header either,

This is the most nearby solution I can find.
\\\\
Private Sub ListView1_MouseHover _
(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ListView1.MouseHover
ListView1.Columns(0).Width = 50
ListView1.Columns(1).Width = 50
ListView1.Columns(2).Width = 50
ListView1.Columns(3).Width = 50
ListView1.Width = 205
End Sub
////

But I hope this helps a little bit?

Cor
 
Back
Top