Skip to content
Loading
how to show checkbox list items in one line using C#
  • Laxmidhar Sahoo
    Hi
     
    1. string s = checkedListBox1.GetItemChecked(0);    
    2. for (int i = 1; i < checkedListBox1.Items.Count; i++)    
    3. {    
    4. if(checkedListBox1.GetItemChecked(i))    
    5. {    
    6. s += "," + checkedListBox1.Items[i];    
    7. }    
    8. }    
    Thanks and regards 
  • Jignesh Kumar
    Hi,
     
    Please trim at end.
    1. SwriteData.WriteLine("(" + s.TrimEnd(','); + ")");