Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a delete funtion, how can I enable / disabled it?

I have a ListBox with users so when I select one of them I can delete him.
I need 2 buttons: one enable / disable so when I click enable it enabless, also a tab control on the listbox to filter enabled / disabled users

I have no idea on how to start with this, I im using MSVS 2015 RC AND SQL server 2012
Posted
Updated 30-Sep-15 22:26pm
v2
Comments
BillWoodruff 1-Oct-15 6:21am    
fyi: .NET does have tri-state CheckBoxes available

1 solution

Make your users members of a class User. Add the bool enable member to User class and use it consistently.
 
Share this answer
 
Comments
jamesmc1535 1-Oct-15 4:32am    
okay i wil try that quickly , and this will also work on the filter? toshow enabled or disabled users
CPallini 1-Oct-15 6:25am    
You may store User instances in the list e override the ToString() method in order to represent the enable/disable info too.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900