Teen Programmers Unite  
 

 

Return to forum top

Help with VB Plz (Ref: Listboxes)

Posted by andymcnab [send private reply] at August 13, 2002, 06:49:20 AM

Hello, I need to know how to count the number of entries(indexes) in a listbox and then put that number in a label, because i am making a database program and have a list of items in a listbox and need to have a label at the bottom stating "There are .. entries in the database". Obviously the .. is the number of entries in the listbox.

Hope you understand Thanx All...

Posted by buzgub [send private reply] at August 13, 2002, 07:10:25 AM

I'm going to be irritated here.

Okay, someone makes a silly request on tpu.org. Normal day, really. "This one should be in the documentation", thinks I. So, Off I go to http://msdn.microsoft.com/. Documentation seems like a likely candidate to be in the library, so I'll go there. I can't see anything in the contents, so I try "Up one level". Bingo! Now I see a "Visual tools and languages" option in the contents. "Let's try that", says I, and try it I do. Within that there lives "Visual Studio 6", and within that was "Visual Basic 6". I see "Product documentation". That looks right; let's go there. It looks useful. Wow.

Okay, now I get another menu. I just want to look something simple up here, so let's go to the "reference". Therein I find a "Controls reference". Wonderful! So, I click on that, then go to "Intrinsic controls" (look up intrinsic in your dictionary if you want to know why I chose that one). Now, shock horror, I see a "Listbox control". The thing I'm looking for seems to be likely to be a property, so I hit "Properties". So, I scan through this list, and what do I find?

Your challenge, should you wish to accept it, is to do as I did, help yourself out here, and scan through that list of properties.

Next time, please RTFM. Thoroughly.

Posted by andymcnab [send private reply] at August 13, 2002, 08:31:07 AM

well that really helps cos i already did that and wanted someone to explain it to me. Looks like u probably dont know anyway so...
Will someone please tell me or give me sample code cos i cant understand it okay then thanx for nothing!

Posted by Psion [send private reply] at August 13, 2002, 08:46:09 AM

If you are unable to use the control reference to figure this and other simple issues out yourself, then you are not ready to be using a language as "complicated" as VB. Sorry, I'm not trying to be nasty, but that is just the way it is.

Posted by andymcnab [send private reply] at August 13, 2002, 09:21:29 AM

well i thought this site helped n00bs out not took the complete piss out of them but oh well...
looks like tpu.org has really gone downhill since last time i was here!
well thats the webmasters and people who run the sites problem.

Posted by Neumann [send private reply] at August 13, 2002, 11:11:20 AM

The solution to your problem is REALLY trivial. It's not that it would take you days to find it. Don't blame the TPU webmasters because they are doing a great job and they actually have other things to do than answering very simple questions and especially questions about Visual Basic 6!

And now, Psion and buzgub may not like me for that but I'll answer your question (but I sure won't bother explaining it!). I'm currently in a good mood because I just finished an exam that went quite well. You may not be so lucky next time...

ListCount

Posted by gian [send private reply] at August 13, 2002, 09:35:57 PM

Andy, you did not exactly explain your problem in depth. It's sorta like walking in and saying "Tell me everything there is to know about shirts" just because you can't be bothered searching "A history of shirts" for the information you want. We are not here to write reference material. Buzgub pointed you to some useful material, and all you did was get angry at us for not writing your program for you.

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.