CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Threaded View

  1. #1
    Join Date
    Oct 2008
    Posts
    59

    Multi Line ListBox

    My application is developig in VC++ 2008. I have a List Box. Where I am Loading some Text data from a text file. After Loaded the listBox is as show in the attached figure :

    I have used it as a SINGLE SELECTION List Box. Here I would like to change as MULTILINE SELECTION so as to delete the selected List BOX datas.

    For the Single Line Delete operation I have written the following code.
    Code:
           CListBox m_parameterlist;
            unsigned int len = m_parameterlist.GetCurSel();
    
    	if(len==LB_ERR)
    	{
    		len = m_parameterlist.GetCount();
    		len = len-1;
    	}
    	int current = m_parameterlist.DeleteString(len);
    	int newcnt = m_parameterlist.GetCount();	
    	CString str;
    	if(newcnt>0)
    	{
    		for(int i = 0;i < newcnt;i++)
    		{
    			m_parameterlist.GetText( i, str );
    		}
    	}
    	else
    		_asm nop;
    This has worked. The single line deleted and the remaining datas listed on ListBx But Now the User requirment got modified. I have changed the property to MULTILINE SELCTION. But the coding is confused.... Can u help me plz...
    Attached Images Attached Images  

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