473,382 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Handling Listbox DrawItem event, now Horizontal scrollbar is broken ???

I am handling the Listbox DrawItem event to enable the listbox strings to be
displayed in different colours for easy reading.

Have set ScrollAlwaysVisible and HorizontalScrollbar to true.

I Anchor the listbox T, L, R, B on the parent form

The string items held within the listbox are quite big, much longer than
could be displayed within the Listbox display area.

When I expand the parent form then more of the string is displayed.

Problem is the Horizontal scroolbar may as well not be there as it constantly
implies there is nothing outside the display area, to display.

Do I need to handle this somehow within the DrawItem event ????

--
Message posted via http://www.dotnetmonster.com
May 16 '06 #1
2 8851
Paul,

I don't know if it helps, but set the DrawMode to OwnerDrawVariable and
handle the MeasureItem event.

In this case the list box will have all information on the size of the items
and probably will update the scrollbar accordingly.

BTW I didn't quite understand what is the problem with the scrollbar.
--
HTH
Stoitcho Goutsev (100)

"Paul_Madden via DotNetMonster.com" <u21795@uwe> wrote in message
news:60556bebe8bab@uwe...
I am handling the Listbox DrawItem event to enable the listbox strings to
be
displayed in different colours for easy reading.

Have set ScrollAlwaysVisible and HorizontalScrollbar to true.

I Anchor the listbox T, L, R, B on the parent form

The string items held within the listbox are quite big, much longer than
could be displayed within the Listbox display area.

When I expand the parent form then more of the string is displayed.

Problem is the Horizontal scroolbar may as well not be there as it
constantly
implies there is nothing outside the display area, to display.

Do I need to handle this somehow within the DrawItem event ????

--
Message posted via http://www.dotnetmonster.com

May 16 '06 #2
Hoi Stoitcho.

Have actually tried the approach you suggested but no joy. The problem is the
following. If my Items (strings) are much too long to be displayed within the
Listbox display window, the scrollbar area is present on the bottom of the
display area, but there is NO scrollbar proper within the scrollbar area,
implying all data for the Items is visible already in the Listbox display
area. When I set the DrawMode to Normal, the slidebar works as expected. As I
say I did try the DrawMode OwnerDrawVariable technique and handle the
MeasureItem event correctly, but still no proper scrollbar support. The
Vertical scrollbar works perfectly fine.

Many thanks for your help and if you can think of anything else (maybe this
is a bug !!) I would appreciate it.

Paul.
Stoitcho Goutsev (100) wrote:
Paul,

I don't know if it helps, but set the DrawMode to OwnerDrawVariable and
handle the MeasureItem event.

In this case the list box will have all information on the size of the items
and probably will update the scrollbar accordingly.

BTW I didn't quite understand what is the problem with the scrollbar.
I am handling the Listbox DrawItem event to enable the listbox strings to
be

[quoted text clipped - 14 lines]

Do I need to handle this somehow within the DrawItem event ????


--
Message posted via http://www.dotnetmonster.com
May 17 '06 #3

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

Similar topics

0
by: markusszil | last post by:
Hello all I have a fairly simple listbox into which I add, insert, and remove strings It has the following property settings HorizontalScrollbar - true HorizontalExtent - ScrollAlwaysVisible...
0
by: Lundy | last post by:
greetings, The listbox control on my aspx page has a vertical scrollbar. But some of the text extends beyond the right limit of the listbox. I don't see a horizontal scrollbar, and I don't...
1
by: e | last post by:
I have an ownerdrawn listbox that paints items in various colors dependant upon whether or not it has focus, selected, etc. The code that physically paints the items is in the drawItem event, and...
7
by: Pachydermitis | last post by:
Hi all you Experts, I need to scroll a listbox horizontally. For the life of me I cannot get it to move. I can successfully scroll it vertically. I have the handle for the listbox and the scroll...
0
by: Mr. Beck | last post by:
I have a simple application that has a listbox for displaying text in it. The functionality of it is to color particular parts of the text that is displayed from a file. I have used similar coding...
0
by: Paul_Madden via DotNetMonster.com | last post by:
I am handling the Listbox DrawItem event to enable the listbox strings to be displayed in different colours for easy reading. Have set ScrollAlwaysVisible and HorizontalScrollbar to true. I...
1
by: Mae Lim | last post by:
Hi all, I have a question, how can I add an horizontal scrollbar to a listbox control? I have tried "overflow:scroll;" using <divbut the scrollbar will be display outside of the listbox. I...
0
by: Mark Smith | last post by:
hi i use an ownerdraw method for coloring some items in the list different then the others. code: private void ListBoxDrawItem(object sender, DrawItemEventArgs e) { ListBox lst =...
0
by: rn5a | last post by:
How do I make a ListBox display the horizontal scrollbar if the text of any of the items in the ListBox exceeds the width of the ListBox? Unlike the vertical scrollbar which gets displayed...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.