ListBox control
-
Sorry I confused some where. so let me post this massage again. Any body kwown please show me how to use List Controlfor in my case that is explained as following: In my dialog, I created two ListBox1 and ListBox2 with multiline and 1 button Send. So when I push button send the String ar row 1 form ListBox1 will be send to ListBox2, that means the string in row 1 of List control 1 will be disappeared and insert to row 1 of ListBox2, the sequence is run step by step up to there is no string in ListBox1 Thank very much.
-
Sorry I confused some where. so let me post this massage again. Any body kwown please show me how to use List Controlfor in my case that is explained as following: In my dialog, I created two ListBox1 and ListBox2 with multiline and 1 button Send. So when I push button send the String ar row 1 form ListBox1 will be send to ListBox2, that means the string in row 1 of List control 1 will be disappeared and insert to row 1 of ListBox2, the sequence is run step by step up to there is no string in ListBox1 Thank very much.
Kiethnt wrote:
Sorry I confused some where. so let me post this massage again.
Why don't you modify your previous post?
Nibu thomas A Developer Programming tips[^] My site[^]
-
Sorry I confused some where. so let me post this massage again. Any body kwown please show me how to use List Controlfor in my case that is explained as following: In my dialog, I created two ListBox1 and ListBox2 with multiline and 1 button Send. So when I push button send the String ar row 1 form ListBox1 will be send to ListBox2, that means the string in row 1 of List control 1 will be disappeared and insert to row 1 of ListBox2, the sequence is run step by step up to there is no string in ListBox1 Thank very much.
try following code. if( ListBox1.GetCount() > 0 ) { CString csText; ListBox1.GetText( 0, csText ); ListBox2.AddString( csText ); ListBox1.DeleteString( 0 ); } where ListBox1 is the control variable for the listbox 1 and ListBox2 is the control variabale for the listbox 2.
nave
-
Sorry I confused some where. so let me post this massage again. Any body kwown please show me how to use List Controlfor in my case that is explained as following: In my dialog, I created two ListBox1 and ListBox2 with multiline and 1 button Send. So when I push button send the String ar row 1 form ListBox1 will be send to ListBox2, that means the string in row 1 of List control 1 will be disappeared and insert to row 1 of ListBox2, the sequence is run step by step up to there is no string in ListBox1 Thank very much.
Can you show your code how do you use of it
WhiteSky
-
try following code. if( ListBox1.GetCount() > 0 ) { CString csText; ListBox1.GetText( 0, csText ); ListBox2.AddString( csText ); ListBox1.DeleteString( 0 ); } where ListBox1 is the control variable for the listbox 1 and ListBox2 is the control variabale for the listbox 2.
nave
My program had run already, I really thank for your help Naveen R. However, the problem here is I want the string will be send continuosly when I push Send button once only. One more question I would like ask you that how to write all string in a Listbox control to file .txt and read string in text file to Listbox control. Please help me solve this problem.
-
My program had run already, I really thank for your help Naveen R. However, the problem here is I want the string will be send continuosly when I push Send button once only. One more question I would like ask you that how to write all string in a Listbox control to file .txt and read string in text file to Listbox control. Please help me solve this problem.
CStdioFile File; File.Open( _T("C:\\listboxdata.dat"), CFile::modeCreate|CFile::modeWrite ); int nCount = m_list.GetCount(); for( int nIdx =0;nIdx< nCount;nIdx++ ) { CString csText; m_list.GetText( nIdx, csText ); File.WriteString( csText ); } File.Close(); Do the reverse for reading...
nave