469,071 Members | 1,935 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,071 developers. It's quick & easy.

List Box values disabling

553 512MB
Hi

I have 2 tick boxes (say A and B) and a list box. I want following, can anyone help

If tick-box A is checked: the list box will show all of its values

If tick-box B is checked: the list box will show only the first 2 values

I know how to write code for tick-boxes, please give help on doing the List Box

thanks
Jul 10 '07 #1
4 1274
Killer42
8,435 Expert 8TB
If tick-box A is checked: the list box will show all of its values
If tick-box B is checked: the list box will show only the first 2 values
I don't think you can hide entries in a listbox. Probably you will have to do one of the following...
  • Add and remove the entries in the listbox each time, or
  • Have two listboxes (one with all entries, one with the reduced list) and make them visible as required.


Oh, a question - what if both of the checkboxes are checked? Or neither?
Jul 11 '07 #2
questionit
553 512MB
Ifboth are ticked or neither, the list box wil lshow all the values.

so how would i implement to remove entried once by one?

I don't think you can hide entries in a listbox. Probably you will have to do one of the following...
  • Add and remove the entries in the listbox each time, or
  • Have two listboxes (one with all entries, one with the reduced list) and make them visible as required.


Oh, a question - what if both of the checkboxes are checked? Or neither?
Jul 11 '07 #3
Killer42
8,435 Expert 8TB
Ifboth are ticked or neither, the list box wil lshow all the values.

so how would i implement to remove entried once by one?
Well, say you wanted to show only the first two entries and remove the rest. One simple way would be...
Expand|Select|Wrap|Line Numbers
  1. With List1
  2.   Do While .ListCount > 2
  3.     .RemoveItem 2
  4.   Loop
  5. End With
Jul 11 '07 #4
questionit
553 512MB
Thats useful for me
Thanks a lot

Well, say you wanted to show only the first two entries and remove the rest. One simple way would be...
Expand|Select|Wrap|Line Numbers
  1. With List1
  2.   Do While .ListCount > 2
  3.     .RemoveItem 2
  4.   Loop
  5. End With
Jul 11 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Jeffrey Silverman | last post: by
2 posts views Thread by Stub | last post: by
3 posts views Thread by PB | last post: by
2 posts views Thread by adeelanjum2001 | last post: by
2 posts views Thread by Ryan Ternier | last post: by
7 posts views Thread by John Meyer | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.