473,544 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
+ 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 1406
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
7940
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' => 'aaa') , array( 'id' => 'B', 'parent_id' => 'A', 'value' => 'bbb') , array( 'id' => 'C', 'parent_id' => 'B', 'value' => 'ccc') , array( 'id' =>...
2
3190
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 determined what pointer type of object is returned the list?
3
1603
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 JavaScript something that is done very much? I know it's impossible to answer that last question definitively - so I'm wondering if it has presented any...
2
1376
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, it is never enabled. i have searched dozens of site looking for this problem. is there any way around of this problem. thanks in advanced
2
3503
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 sorted on, 10 items under 1 heading (example). So I would like a list box to show each heading, with all the Items underneath, but not let the...
7
2215
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
2327
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 words, I have a server control TextBox, I enter some text, my client side scripts do some stuff and in the Page_Load method after submitting the form...
3
2023
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
3634
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 i have failed. Could anyone give me any advice? Dim db As Database Dim rst As Recordset Dim rst2 As Recordset Dim strSQL As...
0
7373
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7625
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7717
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5306
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1848
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 we have to send another system
1
993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.