VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 300,358 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,926 people online right now. Registration is fast and FREE... Join Now!




ListBox Capacity

 

ListBox Capacity, I want to use ListBox without scrollbar and i want to now how many lin

dimi_s

24 Jun, 2009 - 10:46 PM
Post #1

New D.I.C Head
*

Joined: 16 Jun, 2009
Posts: 5

I made a program that passes records from database and displayed then in listbox. The reason that i want to now tha capacity of the listbox is because my program will run in deferent monitors and each operator will be able to change the listbox fontsize.
I want to show them the records like pages
e.g If my database have 25 records and my listbox capacity is 10 records the time, i want to show them the first 10 records for 1 minute then the second 10 records for 1 minute, then the last 5 records for 1 minute and then to start over from the begining

*Is the listbox the correct object? and how can i find capacity for an object?

Thank you for your time and for your help.


User is offlineProfile CardPM
+Quote Post


paperclipmuffin

RE: ListBox Capacity

24 Jun, 2009 - 11:01 PM
Post #2

WinWinWinWindows?
Group Icon

Joined: 16 Apr, 2009
Posts: 881



Thanked: 9 times
Dream Kudos: 400
My Contributions
Can you show us the code you have used so far to try to solve the problem?

Thank you for helping us help you. ph34r.gif
User is offlineProfile CardPM
+Quote Post

vb5prgrmr

RE: ListBox Capacity

25 Jun, 2009 - 04:53 AM
Post #3

D.I.C Regular
***

Joined: 21 Mar, 2009
Posts: 459



Thanked: 30 times
My Contributions
Hint to get you started on your code, TextHeight.

Good Luck


User is offlineProfile CardPM
+Quote Post

NoBrain

RE: ListBox Capacity

25 Jun, 2009 - 05:56 AM
Post #4

D.I.C Lover
Group Icon

Joined: 25 Mar, 2009
Posts: 1,152



Thanked: 33 times
Dream Kudos: 125
My Contributions
but dude the capaciti is different depending on how big your listbox is easy way to do that is to fill it with 25 and see how many is display then just to do your cycle
User is offlineProfile CardPM
+Quote Post

dimi_s

RE: ListBox Capacity

25 Jun, 2009 - 06:10 AM
Post #5

New D.I.C Head
*

Joined: 16 Jun, 2009
Posts: 5

QUOTE(paperclipmuffin @ 24 Jun, 2009 - 11:01 PM) *

Can you show us the code you have used so far to try to solve the problem?

Thank you for helping us help you. ph34r.gif



I dont now how to do it, so i put all the records in the listbox and passed thru them one by one with timer untill the end of listbox.

CODE

'add records to listbox
  With rst
      If Not .BOF Then .MoveFirst
      While Not .EOF
        listbox.AddItem !Stats, intLine
        intLine = intLine + 1
        .MoveNext
      Wend
  End With

'Timer
  If listbox.Selected(intSumLines - 1) = True Then intTimerLine = 0
  
listbox.Selected(intTimerLine) = True
intTimerLine = intTimerLine + 1


i dont like that way, i want to so them the records like pages and because this records will be used for public view i dont now what monitor will they use and what fontsize.

Thank you for your time
I hope i was understandable
User is offlineProfile CardPM
+Quote Post

dimi_s

RE: ListBox Capacity

25 Jun, 2009 - 06:22 AM
Post #6

New D.I.C Head
*

Joined: 16 Jun, 2009
Posts: 5

QUOTE(NoBrain @ 25 Jun, 2009 - 05:56 AM) *

but dude the capaciti is different depending on how big your listbox is easy way to do that is to fill it with 25 and see how many is display then just to do your cycle


Thank you for your help

My listbox use all the form and the form.windowstate = Maximize
My listbox gets the form.width and form.height at run time.
Its easy to solve this with my monitor of 19", But what happens if someone run the program in bigger or smaller monitor.

thank you for your time.
User is offlineProfile CardPM
+Quote Post

NoBrain

RE: ListBox Capacity

25 Jun, 2009 - 06:42 AM
Post #7

D.I.C Lover
Group Icon

Joined: 25 Mar, 2009
Posts: 1,152



Thanked: 33 times
Dream Kudos: 125
My Contributions
now dude dont know for listbox but........... textbox got this property

Property ScrollBars As Integer
read-only
Member of VB.TextBox
Returns/sets a value indicating whether an object has vertical or horizontal scroll bars.

may be that can help you

or not :S
User is offlineProfile CardPM
+Quote Post

dimi_s

RE: ListBox Capacity

25 Jun, 2009 - 06:46 AM
Post #8

New D.I.C Head
*

Joined: 16 Jun, 2009
Posts: 5

QUOTE(NoBrain @ 25 Jun, 2009 - 06:42 AM) *

now dude dont know for listbox but........... textbox got this property

Property ScrollBars As Integer
read-only
Member of VB.TextBox
Returns/sets a value indicating whether an object has vertical or horizontal scroll bars.

may be that can help you

or not :S


Thanks i will try it
User is offlineProfile CardPM
+Quote Post

NoBrain

RE: ListBox Capacity

25 Jun, 2009 - 11:39 PM
Post #9

D.I.C Lover
Group Icon

Joined: 25 Mar, 2009
Posts: 1,152



Thanked: 33 times
Dream Kudos: 125
My Contributions
did you find a way dude i rly want to know if you do and i am sure not only me smile.gif
User is offlineProfile CardPM
+Quote Post

dimi_s

RE: ListBox Capacity

30 Jun, 2009 - 04:17 AM
Post #10

New D.I.C Head
*

Joined: 16 Jun, 2009
Posts: 5

QUOTE(NoBrain @ 25 Jun, 2009 - 11:39 PM) *

did you find a way dude i rly want to know if you do and i am sure not only me smile.gif



I didnt find the way to do it automatic. On the program settings in there where users adjust the size of fonts and the speed that changing the text on the screen I put a setting for users to put how many rows of text there screen fit, depending on the fontsize.

I now that this isn't the write way, but for now it works.

Thanks for help anyway.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 07:37PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month