Trying to remove a checkBox from a list of checkBoxes

Hello,
I have a dictionary that has TKey equal to a Decimal and with TValue equal to a List<CheckBox>. I declare it like so:
Dictionary<Decimal, List<CheckBox>> entireCheckBoxList = new Dictionary<Decimal, List<CheckBox>>();
The reason for doing this is that I can pass it a NumericUpDown value (which only is in Decimal), then I can find any created CheckBox's that corespond to the NumericUpDown value. So let say I have my NumericUpDown equal to 1, when I click on the up
arrow, I pop-up a new form window that lets me enter data lets say folder name and file name. Then, when I click my save button, I create check boxes for a folder name and under that check box is a the file name but it is slightly indented to the right and
under it:
So the reason why I have a Decimal TKey is that when i pop up a new form to create checkBoxes, I can create as many check boxes as I want and only want to assign them to one number. So if I create 4 check Boxes in one form pop-up form, then I want the numberUpDown
value to only be increased by one when I save it and create them. 
So my main question is, when I click down on the numericUpDown arrow, I want to remove the index associated with the numericUpdown from both the control and this dictionary. I am able to remove from the dictionary like so:
entireCheckBoxList.Remove(numbericUpDownValue);
However now I want to remove from the control with something like this:
this.tabPage1.Controls.Remove(entireCheckBoxList[numbericUpDownValue]);
But I am receiving the following errors:
Error 1
The best overloaded method match for 'System.Windows.Forms.Control.ControlCollection.Remove(System.Windows.Forms.Control)' has some invalid arguments
Error 2
Argument 1: cannot convert from 'System.Collections.Generic.List<System.Windows.Forms.CheckBox>' to 'System.Windows.Forms.Control'.
All I want to do is remove the check boxes associated with the numericUpDown value from the control that correspond to the ones created and stored in my dictionary List<CheckBoxes>. I am just not sure how to do it.
Kind Regards.

Ok great thanks for this. 
I have just realized that if I can just remove the last item in the entireCheckBoxList dictionary added, then there is no reason for the numbericUpDownValue look up. I just need to remove the last item in this dictionary.
I have tried many things to get the last item in the dictionary but are all out of ideas.
Any clue?
I have done this:
var test = entireCheckBoxList.Last();
then since this gives me the last value, I have then looped through like so:
foreach (CheckBox item in test.Value)
Then to remove only the last items created, since they are done in pairs, i have done this:
count++;
if ((count == test.Value.Count - 1) || (count == test.Value.Count))
this.tabPage1.Controls.Remove(item);
else
if (!yourlist.Contains(item))
yourlist.Add(item);
entireCheckBoxList.Add(count, yourlist);
where count is an int declare above. So the final solution is this:
var test = entireCheckBoxList.Last();
int entireCheckBoxCount = entireCheckBoxList.Count;
List<CheckBox> yourlist = new List<CheckBox>();
int count = 0;
entireCheckBoxList.Clear();
foreach (CheckBox item in test.Value)
count++;
if ((count == test.Value.Count - 1) || (count == test.Value.Count))
this.tabPage1.Controls.Remove(item);
else
if (!yourlist.Contains(item))
yourlist.Add(item);
entireCheckBoxList.Add(count, yourlist);
What do you think?
Kind Regards.

Similar Messages

  • Is there a way to remove an app from the list of previously installed apps?

    Is there a way to remove an app from the list of previously installed app?
    The list that comes up when you click on the Purchased icon when updating apps.
    The list is becoming quite large after I installed and tried out a few apps.

    nvm. I found it.

  • I would like to know, on the ringtone page, where you can select songs out of your music library, is there a way to remove a song from the list after its selected? I would thin there would be a way to "delete" the songs from the list. (Clock app)

    I would like to know, on the ringtone page, where you can select songs out of your music library, is there a way to remove a song from the list after its selected? I would thin there would be a way to "delete" the songs from the list. (Clock app)
    Let me explain:
    In the clock app for ios 6.0.2 I am a little confused. It allows you to go into your music library, and create a ringtone using any songs you choose. However, I cannot find a way to remove a song from this list, just like I cannot delete one of the preset ringtones (which I'm not trying to do, but just as an example)
    Thanks for your time! If you need more information just ask.
    (I believe both my iPod and iTunes are up to date)

    I believe you just are able to delete them from iTunes.
    Hope it will be helpful

  • How do I remove a device from the list?

    I had an old Bluetooth device that I no longer own. Its name still appears in my Bluetooth list. How do I remove it? The Troubleshooting manual says:
    8. How do I remove a device from the device list?
    Using the Bluetooth preferences, select the device you want to remove to highlight it, then click the minus sign. It is recommended that you remove a device from this list while the device is connected.
    This does not work. There is no minus sign anywhere. I tried clicking the minus sign on my keyboard, but that is not it. Any suggestions?

    Its name still appears in my Bluetooth list.
    What Bluetooth list? You've completely neglected to tell us what mobile device or computer running what operating system you are referring to.
    I'll make a guess that you're using a Mac. If I'm right, the minus sign is here:

  • How to remove available downloads from the list

    how to remove available downloads from the list without it resuming when i open itunes or check for available downloads?

    There is not a way to remove them from the list.  Just let them download, and then delete them from your library when they are done.

  • HT1918 Trying to remove credit card from itunes account

    Trying to remove credit card from daughters itunes account. I erase the billing information and click continue but it will not allow me to exit and save without putting some kind of billing information.There is no "None" option for me to select. What can I do?

    If you only want the free apps, take a look here:
    http://support.apple.com/kb/HT2534
    Read the steps carefully as the order in which you follow them is  critical. Note that you can do this only when creating a new Apple ID. You cannot use an existing ID. 
    You will of course not be able to get anything other than the free apps without entering in some sort of payment method (credit card, prepaid iTunes card, gift certificate, etc.)
    Regards.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base, before you post a question.

  • I tried to remove a role from one of my 2012R2 DC's

    I tried to remove a role from one of my 2012R2 DC's and now I basically can't do anything to that DC.  Attempting pretty much anything on it tells me that it can't do it because it needs a reboot, and a reboot fixes nothing.  The role I wanted
    to delete is removed (print services), but I can't re-add it, or change any other role or feature.  There is a 'pending.xml' file, and it is rather large.  I can't delete, or rename the 'pending.xml' file, as it is owned by 'TrustedInstaller'.  This
    is the FSMO DC and there are some other services on it that I would rather not have to re-install and reconfigure. I've looked for other things that could prohibit installs and more, but there are no 'Pending Renames' in the registry.
    At least getting server manager to stop complaining would be a good start.
    Thanks in advance for any assistance.

    Hi Mike,
    Just addition, please run
    sfc /scannow command to scan all protected system files and use
    Chkdsk command to check the status of the disk in the current drive. any find?
    à
    The role I wanted to delete is removed (print services), but I can't re-add it, or change any other role or feature.
    Just a confirmation, did you mean that had un-install
    print services successfully? No error occurred? Please check relevant log file (such as event log file and so on) if find some errors. In addition, I noticed that you attempt to re-install the role. Did you get any error message when failed to re-install?
    Did you use Install-WindowsFeature PowerShell command to install? Any difference?
    If any update, please feel free to let us know.
    Hope this helps.
    Best regards,
    Justin Gu

  • TS4006 remove the device from the list iCloud

    Hello, tell me how to remove the device from the list iCloud when m is that I had already sold and have no access to it?
    thank you

  • Removing old sources from source list

    Between all the members of the family we've synched up quite a few machines with our Apple TV. But now many of them are gone, yet they are still listed as grayed-out "sources" in the AppleTV menu. Any ideas on how to remove them from the list?

    Welcome to the  Discussion Forums.
    If you select the greyed out library there is an option to disconnect from itunes library, I've never actually tried this and am not certain what it does but I'm sure it's worth a go, otherwise it may be a restore is what is needed.

  • Removing specific element from a list

    Hello, I'm very new to java, and to programming in general.
    I'm trying to write a secret santa app for my family for christmas. Essentially the idea is that 7 names are put into a list, and each time a name is "pulled" (i.e. randomly assigned to a name /= itself) it will be removed from the list of available names to assign.
    String[] nList = { name2, name3, name4, name5, name6, name7 }; // store names for random use
    Random r = new Random();
    name1assign = nList[r.nextInt(nList.length)];
    String[] nList2 = { name1, name3, name4, name5, name6, name7 };
    name2assign = nList2[r.nextInt(nList2.length)];
    My goal for this is to take the string that is equal to name1assign, and remove an element with that string from nList2.
    Can anyone give me some advice in this matter?
    Thanks.

    Sometimes a null value is used to indicate an 'empty' array element, but it would be better to try collections instead.
    You could use an ArrayList instead of an array. This has methods to remove items by index or value.
    An ArrayList also works with Collections.shuffle, which allows you to simply iterate over the list and not deal with random or removing elements at all.

  • How to remove a number from a list controlling a table

    i'm controlling data that enter to a table by using a specific one from them,let's call it "number of the user", when a client has the num 5 and enters his data ;it will be stocked in the 5th row.i want this number 5 to be removed from the list ,so when a new user try to enter num 5 he gets a message"number already used" so he have to enter a different number than 5,for instance 8,consequently i'll get all his data in the 8th row.
    if anyone know a little trick to solve this problem
    thanks

    this number has to be a shared variable,every client is concerned .
    "There is no need to keep track of anything seperately. Simply check if the requested row has already been filled or not." i'm not sure if i get your point,because i don't want a new user to even try to fill data in same row,for example 5,the moment he enters 5 in "NR_ORDRE" he gets a message"it's already taken" or use a combo box containing numbers when a client use one it gets deleted for the upcoming client.
    Attachments:
    NR_ORDRE unique.vi ‏14 KB

  • I am trying to remove an object from a photo such as the back of a person's head.  How do I do this?  I have iphoto '09.

    I am new to iphoto and am trying to figure out how to remove an object from a photo (ie the back of a person's head, or an arm in a photo that seems to belong to no one).  I have iphoto '09.

    You need an external editor for that kind of work.
    In order of price here are some suggestions:
    Seashore (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto. 
    Regards
    TD

  • I'm trying to remove the searchbar from the menu and the conventional techniques aren't working, are thereany other ways to remove the search bar?

    I'm trying to remove the search bar from the menu, but when I try it removes the navigation bar as well. Mozilla's help page shows there being a button to remove in the customize menu section, but it's not here so is there any other way to remove the search bar?

    Hi Ashley Clavette,
    The Initial view setting works perfectly when the file is opened in Acrobat after setting the desired Initial View.
    When you upload the file onto Wordpress, and view it on that website in the browser...it might be using a different pdf handler program which might be causing this issue ( it would be helpful, if you could provide the screenshot) , however when you download the pdf again from wordpress server...and open in Acrobat/Reader...then what  exactly happens ?  Does the pdf opens in the desired Initial View setting?
    Rahul

  • How to display all items titles from custom list with checkbox to select for each user

    Hi All,
    I have a requirement in a sharepoint 2013 development project.
    A custom list items will be created by admin with the following columns:
    Title
    Hyperlink
    User business unit (This column which is a metadata will be a userprofile property)
    In a page/form I have to display the list of titles with a check box based on each user business unit and each user will be allowed to check the list of titles and hit save. And then have to display the list chosen by the user in a webpart.
    If they want to modify their list they have to go to the page/form again and will uncheck the list.
    Am not sure whether I can achieve this through sharepoint out of box feature, I have not done any custom development.
    Please provide your valuable suggestions/ideas on this. Thanks for looking on this !!!

    Hi,                                                             
    Per my knowledge, there are no such OOTB features can meet your requirement, however, there is a workaround that if you can modify your requirement a bit.
    Based on your description, you want different users be able to select values from a list and generate a list own by them.
    If this is what you mean, we can do it like this:
    1. Create another list "Users" which stores the names of every users;
    2. Create a list "Result" which will be available for every user to add their own items, this list will have four Lookup columns and they look up to the "Users" list and the
    list you mentioned before;
    3. Users can add items into "Result" list by selecting the needed values from the other two list, then the items he/she created will be connected to them with the help of the
    Lookup column which looks up to the "Users" list.
    4. You can take use of the OOTB permission management of list to control the access of each item in the "Result" list, and it will be easier for you to manage and filter the
    information you needed.
    The links below about Lookup column for your reference:
    http://office.microsoft.com/en-us/sharepoint-server-help/create-list-relationships-by-using-unique-and-lookup-columns-HA101729901.aspx
    http://www.dummies.com/how-to/content/lookup-columns-in-sharepoint-2010.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • Using ps trying to remove an object from a picture, following steps but when object is removed area is replaced by another portion of the photo like someones face as opposed to what should normally be in the background

    using PS on a regular computer windows 7 tryng to remove an object from a picture,  following steps in the tutorial however when the object is removed it is replaced by another (unwanted) portion of the photo i.e. someones face  instead of what would have normally been in the background

    Well, we can't know. You have not told us what tools you use and what steps nor provided any screenshots. From your description it simply sounds like you are following some tutorial (which again we know nothing about because you haven't told us which one) and getting things wrong. You need to do much better if you want people to help you.
    Mylenium

Maybe you are looking for

  • Expanding Text Options

    I'm putting together a photo book of old photos that I have scanned and need to include a lot of annotations. The formal theme I have been using doesn't seem to allow additional text to be added once you fill the text box frame. Is there any way to e

  • Missing Thumbnails in Windows XP x64

    How can I get thumbnails preview of PDF files in Windows Explorer? Operating system Windows XP x64 ps. I have firstly installed adobe reader 8.1.2, but then unistalled it and then tried versions also 7.0.9, 8.0, 8.1.1 without having thumbnail preview

  • Revaluation of Foreign Bank GL Accounts (Main & Sub Accounts)

    Dear All, Please clarify the Below. If Company code currency is INR and Bank Account is maitained in USD for 100101(main bank Acct) , 2 sub Accounts 100102-Incoming Bank Acct and 100103-Out going Bank Acct.( These sub accounts are maintained on open

  • Set default company color

    Dear all, Would like to ask about how to set default color of the company. I tried to set it from Window->Color, but then after logout and login again, it changed back to the default color... Thanks in advance

  • Another flashplayer will not install problem.can anyone help please?

    Over several months I have been unable to get Flash Player on computer, have followed several 'similar threads' [specifically message 2644369] by uninstalling, with  fpdownload.macromedia.com- twice ,stopping virus checkers etc , reinstalling. (via r