Solved

LISTBOX control

Posted on 1998-12-31
5
159 Views
Last Modified: 2010-05-03
I know is this probably a stupid question, I found a property on the listbox control that allows the items to be checked.  However, I cannot find any way to reference the item if it is checked.  What is the wat to do this?  For example this is what I want to do:

for i =0 to list1.listcount-1
if list1.list(i).value=true then
msgbox(list1.list(i)
end if
next

However, It seems it will not work.  I am setting up a timer event, I want the user to be able to check mutiple hours for the timer to be executed, and I don't want to put 24 checkbox buttons on the form.

Thanks
0
Comment
Question by:windows1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:vmano
ID: 1453429
for the listbox control, there is a property called "Selected". i think that is what you are lookig for.

vmano
0
 
LVL 3

Accepted Solution

by:
jbil earned 100 total points
ID: 1453430
Dim i
For i = 0 To List1.ListCount - 1
    If List1.Selected(i) = True Then
     MsgBox (List1.List(i))
    End If
Next
0
 

Author Comment

by:windows1
ID: 1453431
Thank you so much!  Also, The listbox is forcing the horizontal scrollbar even thought they all the times fit, it forces a scroll bar and duplicates the last column.   For instances I have a columnt 6 am to noon and a 2nd column from 1 to 6, the one to six is listed 2 times it forces a scroll bar. is there a way to remove this?

thanks
0
 
LVL 3

Expert Comment

by:vmano
ID: 1453432
i don't see how my comment is different from jbil's answer. anyway, i will let jbil answer your next question also.

vmano
0
 
LVL 3

Expert Comment

by:jbil
ID: 1453433
Scrollbar depends on size of listbox and size of font.
list width has to be wide enough to stop scrollbar.
one way is in design mode fill (list) with num of entries, in your case 12 then stretch the list until it lines up the way you want with no scroll bars. then you can delete the list and add the real list now or at run time.

Thanks for the points
 
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question