473,468 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

List Box values disabling

553 Contributor
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 1403
Killer42
8,435 Recognized Expert Expert
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 Contributor
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 Recognized Expert Expert
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 Contributor
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

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

Similar topics

5
by: Jeffrey Silverman | last post by:
Hi, all. I have a linked list. I need an algorithm to create a tree structure from that list. Basically, I want to turn this: $list = array( array( 'id' => 'A', 'parent_id' => null, 'value'...
2
by: Stub | last post by:
If building a list of elements of void * type, this way different pointer types of objects can be put in the list. When you pop data from the list, can RTTI or any other method be used to...
3
by: PB | last post by:
What is the rationalle for disabling JavaScript. AFAIK, the primary reason is for "security purposes" - but what specific kind of threats does the protect against? AND - is the disabling of...
2
by: adeelanjum2001 | last post by:
i am using radiolist box control in my page. when i disable radiolist box when page is displayed first time, that is not ispostback, and when i try to enable it with my javascript code afterwards,...
2
by: Ryan Ternier | last post by:
I'm looking for a solution to a problem. We have a list of 10-100items that will be in a dropdown list. Users need to select an Item to perform a function. Each Item has a Heading that it's...
7
by: John Meyer | last post by:
I have a program where I have to enable or disable a list box based upon a radio button. Is there an "enabled" property on select boxes?
5
by: sklett | last post by:
I'm not real experienced with asp.net so this may be obvious. I've got a situation where some of my client side javascript is causing my posted form's controls to lose their values. In other...
3
by: questionit | last post by:
I have options in a List Box How can i disable/make non-visible one value when a Command button is clicked? Thanks
1
by: Constantine AI | last post by:
Hi i am trying to get User input if data does not exist within a DLOOKUP table. I have gotten it to work for one record but not multiple, i have tried to incorporate my code into a loop procedure but...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.