CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    3

    Copy selected items checkedListBox ?

    Ok, I am working on something that the user selects one of their drives in a combo box, upon comboBox_SelectedIndexChanged , the directorys are added to the the checkedListBox1:
    Code:
    checkedListBox1->Items->AddRange(IO::Directory::GetDirectories(comboBox1->SelectedItem ));
    This part works fine,
    Onto the second part, Once the user checks the directories he wants copying, he presses a button. I have got this button to create a string with the checked directorys shown. (Basically from msdn):
    Code:
    // Determine if there are any items checked.
    			if(checkedListBox1->CheckedItems->Count != 0)
    			{
    // If so, loop through all checked items and print results.
    			String ^ s = "";
    			for(int x = 0; x <= checkedListBox1->CheckedItems->Count - 1; x++)
    			{
    			 s = String::Concat(s,checkedListBox1->CheckedItems[x]->ToString());
    			}
    //Out put selected directories as a message box
    			MessageBox::Show(s);
    This creates a message box with the selected directories written
    Example (seen in messagebox):
    Code:
    H:\PS3/EXPORT/BACKUP/200809211826H:\PS3/EXPORT/BACKUP/200806210713
    This example show that the user checked two directories, (Each one starting with a H:\)

    1. Firstly How can I copy directories in VC++ to a specified location? I have found THIS for VisualBasic, but as Im using VC++ its not much use.. Is there an equivalent?

    2. How can I use the checked items in a checkedListbox as a source directory for copying, would I have to limit to only one checkbox selectable?

    3. Thanks!

  2. #2
    Join Date
    Nov 2008
    Posts
    3

    Re: Copy selected items checkedListBox ?

    This is in wrong section, Please delete!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured