473,480 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need to calculate numbers of lines in listbox?

new
Hello
I am using the following to calculate the number of visible lines in
a listbox. This works, but when I add a horizontal scroll bar it
does not work correctly. How can I subtract the size of the
horizontal bar to maintain correct value?

number_of_lines = listbox1.Height / listbox1.ItemHeight
Sep 21 '08 #1
2 2339
Hi,

"new" <nu**@null.comwrote in message
news:Oi**************@TK2MSFTNGP02.phx.gbl...
Hello
I am using the following to calculate the number of visible lines in
a listbox. This works, but when I add a horizontal scroll bar it
does not work correctly. How can I subtract the size of the
horizontal bar to maintain correct value?

number_of_lines = listbox1.Height / listbox1.ItemHeight
Try using listbox1.ClientSize.Height

Sep 21 '08 #2
new
Hello
I am using the following to calculate the number of visible lines in
a listbox. This works, but when I add a horizontal scroll bar it
does not work correctly. How can I subtract the size of the
horizontal bar to maintain correct value?

number_of_lines = listbox1.Height / listbox1.ItemHeight

Try using listbox1.ClientSize.Height
I can't find it?
Sep 21 '08 #3

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

Similar topics

6
7838
by: R.Wieser | last post by:
Hello All, I'm trying to get a "Virtual Listbox" to work. I've currently got a form, and used CreateWindowExA to create a ListBox with the LBS_OWNERDRAWFIXED and LBS_NODATA flags on it. I've...
1
4934
by: Andrew S. Giles | last post by:
I am trying to provide a list to the user. This list is the 1st 25 lines of a given file. I want to provide the line number to the user, before each line. I see when I add Columns to a...
2
4417
by: Keith Kowalski | last post by:
I anm opening up a text file reading the lines of the file that refer to a tif image in that file, If the tif image does not exist I need it to send an email stating that the file doesn't exist...
13
3207
by: Fao | last post by:
Hello, I am having some problems with inheritance. The compiler does not not return any error messages, but when I execute the program, it only allows me to enter the number, but nothing else...
3
4539
by: ali | last post by:
i have to creat a programme that Accept any collection of real numbers up to 25.Calculate and display the average then Find and display the median--the number closest to the middle. i did i wrote...
3
2395
by: lawrencec | last post by:
Hi there, I'm trying to add the values of a number of form fields and to get a result at the end. It must loop and be able to dynamically update the result of calculation. I have attached the...
0
5559
by: raypjr | last post by:
Hi everyone. I'm new here and hope I can get a little advice on how to list my array into a ListBox. I have my structure and array of structures. I need help with a For Loop that will list the...
2
1992
by: raypjr | last post by:
Hi everyone. I'm new here and hope I can get a little advice on how to list my array into a ListBox. I have my structure and array of structures. I need help with a For Loop that will list the...
8
2761
by: jac130 | last post by:
I need to create a calculator using combo boxes/procedures/functions etc... and some other stuff. most of it works properly, but, i need to create a user defined function that checks if both input...
0
7048
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,...
0
6911
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...
0
7050
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,...
0
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4488
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...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
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 ...
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.