473,701 Members | 2,728 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ensurevisible doesn't work in listview when scrollable = false

Hello all

I'm using a listview in my app but I want to scroll the listview
programatically as I hate the look of the standard scrollbar.

So, the listview is scrolled programatically using ensurevisible, ie the
listview shows a maximum of 6 items and if I want to scroll down one I use
the code...

listview.ensure visible(listvie w.TopItem.Index + 6)

The problem I have is that I hide the vertical scrollbar using scrollable =
false but, when that is set, ensurevisible doesn't work. It seems that
ensurevisible depends on the listview being scrollable but I the only way I
can find to hide the scrollbar is to set scrollable to false.

Does anyone know of a way to either hide the scrollbar while keeping
scrollable to true or make ensurevisible work when scrollable = false?

Any help would be greatly appreciated.

Thanks
Ben
Mar 23 '06 #1
2 4092
The first thing I would try would be to change this property just the time
of the EnsureVisible call...

--
Patrice

"Ben H" <Be**@discussio ns.microsoft.co m> a écrit dans le message de news:
5F************* *************** **...icrosof t.com...
Hello all

I'm using a listview in my app but I want to scroll the listview
programatically as I hate the look of the standard scrollbar.

So, the listview is scrolled programatically using ensurevisible, ie the
listview shows a maximum of 6 items and if I want to scroll down one I use
the code...

listview.ensure visible(listvie w.TopItem.Index + 6)

The problem I have is that I hide the vertical scrollbar using scrollable
=
false but, when that is set, ensurevisible doesn't work. It seems that
ensurevisible depends on the listview being scrollable but I the only way
I
can find to hide the scrollbar is to set scrollable to false.

Does anyone know of a way to either hide the scrollbar while keeping
scrollable to true or make ensurevisible work when scrollable = false?

Any help would be greatly appreciated.

Thanks
Ben

Mar 23 '06 #2
Patrice, thanks for replying.

Yes, that's good thinking but I already tried that. I tried...

listview.Scroll able = true
listview.ensure visible(listvie w.TopItem.Index + 6)
listview.Scroll able = false

but it doesn't work. If I rem out the last line it works but of course the
scrollbar is still there so it seems that as soon as you turn off scrollable
the listview is reset to the its initial state.

"Patrice" wrote:
The first thing I would try would be to change this property just the time
of the EnsureVisible call...

--
Patrice

"Ben H" <Be**@discussio ns.microsoft.co m> a écrit dans le message de news:
5F************* *************** **...icrosof t.com...
Hello all

I'm using a listview in my app but I want to scroll the listview
programatically as I hate the look of the standard scrollbar.

So, the listview is scrolled programatically using ensurevisible, ie the
listview shows a maximum of 6 items and if I want to scroll down one I use
the code...

listview.ensure visible(listvie w.TopItem.Index + 6)

The problem I have is that I hide the vertical scrollbar using scrollable
=
false but, when that is set, ensurevisible doesn't work. It seems that
ensurevisible depends on the listview being scrollable but I the only way
I
can find to hide the scrollbar is to set scrollable to false.

Does anyone know of a way to either hide the scrollbar while keeping
scrollable to true or make ensurevisible work when scrollable = false?

Any help would be greatly appreciated.

Thanks
Ben


Mar 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4730
by: Anushya devi | last post by:
Hi All I used listview and tried to update it by using Addrange. When the number of items is less, it works fine.. But I need to update nearly 200,000 items and it hangs. Also i need to add images to listview also(This is to list all the items in my inbox, and want to give the user the feel of outlook). Since it hangs for even 1000 items in the inbox, i tried to shift to virtual listview. But virtual listview
0
1478
by: Kovan | last post by:
I have a small problem, i am designing a custom interface and i need to turn off the scrollers of a listview but be able to programmically choose items (all this is fine) the problem is that .EnsureVisile() only works when the scrollers are = true, what are my other alternatives? Kovan,
0
2884
by: Tim Bücker | last post by:
Hello. Is it really not possible to hide the scrollbars of a listview ( this.listview.Scrollable = false; ) but do some scrolling anyway ( for instance: PostMessage(this.listview.Handle, WM_VSCROLL, wParam, lParam); ) I really hope someone can tell me that it is possible... .... I want to do the scrolling using a custom scrollbar at another position ....
21
5210
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each table and 11 sub items with data about each column. When a Row in ListView1 is selected the Data in ListVies2 is loaded to show the correct data. Initially the first row in ListView1 is selected in FormX load
1
16970
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot examples I found on the web. Works in IE and mozilla. http://www.imaputz.com/cssStuff/bigFourVersion.html
2
6828
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the form every thing works fine: checking items by code
0
1228
by: Shaw | last post by:
Hi, I have a ListView (details) which I have the scrollable property set to false. Under XP - this works well, however under Vista the scrollbars appear. Is this a know problem - and is there a way to hide them?
1
3673
by: schaf | last post by:
HI NG! I have a problem which is very confusing for me. In my app it is possible that the tree view will be cleared and created completely new. To provide nice usability i would like to expand all nodes, which were expanded before the new creation of the tree view. So I save the first child node of all expanded nodes in a arraylist and use a clone of this array list after the new creation of the tree view.
4
4509
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea is that when clicking on the "Show details" button the ListView for the appropriate row binds in the codebehind and displays the detail data for the selected row. I did something similar with a gridview control previously, but want to be able to...
0
8737
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8649
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9084
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5905
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4411
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3104
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2036
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.