473,499 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to deactivate........

22 New Member
Hai,,,, i forget d vb concepts... plz help me...n what my problem is i hav a 2 list boxes and hav some numbers on that list.. my need is i want to deactivate the number in the second list box which one is present in the first list box.... this wil be happen after i choosen the number in the first list box..... tel me...... plz...
Apr 2 '07 #1
9 1265
devonknows
137 New Member
Hai,,,, i forget d vb concepts... plz help me...n what my problem is i hav a 2 list boxes and hav some numbers on that list.. my need is i want to deactivate the number in the second list box which one is present in the first list box.... this wil be happen after i choosen the number in the first list box..... tel me...... plz...
Hmm you cant specifically deactivate specific items in a listbox well not without removing them but then you would have to renew the list afterwards something like this would be useful

Expand|Select|Wrap|Line Numbers
  1. Private Sub List1_Click()
  2.     If List1.Listindex = -1 Then Exit Sub 'Check To See If Anything Is Selected
  3.     List2.Enabled = True
  4.     Call List2_Click() 'Makes List2 Click on the selected item in case List1 item is changed
  5. End Sub
  6. Private Sub List2_Click()
  7.     If List2.ListIndex = -1 Then Exit Sub 'Check To See If Anything Is Selected
  8.     if List1.List(List1.ListIndex) = List2.List(List2.ListIndex) Then 
  9.         'If Both Selected items in List1 and List2 are the same then Exit the 
  10.         'Sub so that no other commands will run.
  11.         Exit Sub
  12.     Else
  13.         'Do you commands here
  14.         'other commands
  15.         'other commands
  16.     End If
  17. End Sub
  18.  
I believe something like that will help you with what you are looking, so basically it checks to see if there is anything selected if not stop the code, then it checks to see if list1 and list2 are the same then exit sub to stop the code from continuing else... well you put your commands there.

Kind Regards
Devon.
Apr 2 '07 #2
vijaydiwakar
579 Contributor
Hai,,,, i forget d vb concepts... plz help me...n what my problem is i hav a 2 list boxes and hav some numbers on that list.. my need is i want to deactivate the number in the second list box which one is present in the first list box.... this wil be happen after i choosen the number in the first list box..... tel me...... plz...
u may use enable and /or locked property to do so
Apr 2 '07 #3
Indianraja
22 New Member
Thank u
actually what is my need is i want to deactivate the number in the list2 box which one is selected by the user in list1 box....

i think """if List1.List(List1.ListIndex) = List2.List(List2.ListIndex) Then """ this one is help ful for me...... u gave it na.... k... after this, wht i want to give to deactivate the particular no in list2 box......
Apr 2 '07 #4
Indianraja
22 New Member
Thank u

i knw i must want to use enable command..... but i studied vb 2 years back.... so slighly i forget the commands.... thats y i asked....
Apr 2 '07 #5
vijaydiwakar
579 Contributor
Dear use replay button to let the person know
Apr 2 '07 #6
Indianraja
22 New Member
sorry,,,, i have one doubt in your codings.....
u call list2_click() in list1_click(). And my need is after i select one number in list1 only same list 2 box no will go on to deactivate.... so please clarify my doubt.....
Apr 2 '07 #7
Indianraja
22 New Member
sorry,,,,,, i m the new one to this... thats y..... k........
Dear use replay button to let the person know
Apr 2 '07 #8
vijaydiwakar
579 Contributor
sorry,,,, i have one doubt in your codings.....
u call list2_click() in list1_click(). And my need is after i select one number in list1 only same list 2 box no will go on to deactivate.... so please clarify my doubt.....
see this is not my code but possibly might be
Apr 2 '07 #9
Indianraja
22 New Member
see this is not my code but possibly might be
k thx.....
Apr 2 '07 #10

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

Similar topics

0
528
by: Rick | last post by:
I am trying to stop the screen saver from running based on a external trigger from our application. I have a .Net application and I am using interop to make a SystemParameterInfo() call to...
14
2788
by: Seth Russell | last post by:
I'm running Kevin Roth's rte box and i want to deactivate the ability to past inside the box. People sometimes paste outrageous things in there that might break my site. How can I deactivate the...
5
3769
by: Maxine G | last post by:
I have two forms, a menu and a data entry form. The entry form is bound to a query against linked SQL server tables. In the deactivate event, I have some code which asks the user if they want to...
0
1080
by: henrycortezwu | last post by:
Hi, I would like to inquire on how to make an event that will simulate the browser loosing focus, or the browser deactivate or inactive state event. Like in Windows Form, there are several events...
3
3471
by: active | last post by:
I remember when I checked NewGroups for comments about the VB6 Activate event and found that many thought it was not a reliable way to keep track of which form has focus. There was enough bad press...
0
300
by: Lance | last post by:
By default it seems that there always must be an active MDI child form. But, I want to deactivate all of the MDI child forms when the user clicks on a control that is owned by the MDI parent. This...
0
1351
by: ofzer | last post by:
Hi .. I wrote a windows application in perl/tk. I would like to deactivate parent windows when I open new one. for example : lets say I am in the main window now and I press on the...
0
1471
by: Arif Khan | last post by:
I am getting folllowing error in one of the service components. I have not override base class's (ServicedComponent ) Deactivate function. Also it's library component called by asp.net worker...
7
2155
subashini Thiyagarajan
by: subashini Thiyagarajan | last post by:
Hi , In ASP how to deactivate few fields while inserting a record to the database(access). i want to insert a record.e.g having 5 fields.it is not reqired to fill all the fields in a form as...
5
9177
by: Andrew Morton | last post by:
Is it possible to make a form deactivate itself without minimizing it? I have written a small utility which copies selected files from CDs (hundreds of them). I put a CD in the tray and click a...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7178
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
5475
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,...
1
4919
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...
0
4602
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
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
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 ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
302
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...

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.