Turn labels from a CheckBoxList into strings

0

I have checkboxlist with some items and their names are the directories so I can save the file. I would like to know how I get the name of each label selected from checkboxlist and turn it into a string . I would like to know a way for it to save multiple files at once, which are the ones in checkboxlist .

private void bt_salvar_Click(object sender, EventArgs e)
{
    clsMCI clsmci = new clsMCI();
    string ArtistaDoAlbum;
    string Artista;
    TagLib.File tagFile = TagLib.File.Create(aqui onde gostaria que o nome da label selecionada estivesse);
    tagFile.Tag.Title = tx_titulo.Text;
    tagFile.Save();
}
    
asked by anonymous 23.04.2014 / 08:55

1 answer

3

Here are some examples of how to capture text from a CheckBoxList

string ex1 = chkLista.SelectedItem.Text;
string ex2 = chkLista.Items[0].Text;

To save a record for each item I believe the best way is for you to make a foreach, if you have misunderstood please better detail the problem.

OBS : chkLista = ID OF YOUR OBJECT

    
23.04.2014 / 14:41