Click here to Skip to main content
15,917,538 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: reading file 's header Pin
pnpfriend20-Jun-03 6:43
pnpfriend20-Jun-03 6:43 
GeneralRe: reading file 's header Pin
John M. Drescher20-Jun-03 6:52
John M. Drescher20-Jun-03 6:52 
GeneralFile Reading Problem In Release Only Pin
John R. Shaw13-Jun-03 7:07
John R. Shaw13-Jun-03 7:07 
GeneralRe: File Reading Problem In Release Only Pin
John R. Shaw13-Jun-03 8:23
John R. Shaw13-Jun-03 8:23 
GeneralSolved Pin
John R. Shaw13-Jun-03 8:32
John R. Shaw13-Jun-03 8:32 
Generalmaking a 64 bit long out of 2-32 bit doubles Pin
johnstonsk13-Jun-03 6:56
johnstonsk13-Jun-03 6:56 
GeneralRe: making a 64 bit long out of 2-32 bit doubles Pin
Nitron13-Jun-03 7:38
Nitron13-Jun-03 7:38 
GeneralListBox with Columns Pin
Hosam Aly Mahmoud13-Jun-03 6:48
Hosam Aly Mahmoud13-Jun-03 6:48 
Hello everyone.

I have a dialog to show the scores of a game, and I put a list box in that dialog. I want to show the names and the scores in a table. I just can't find a reference to tell me anything about how to make columns in a list box.

I tried something else to temporarily solve the problem, but something is going wrong. I wrote the following piece of code:
CString Score, Name, Final;
CRect ScoreRect (0,0,0,0), MyListRect;
CListBox *MyList = static_cast < CListBox* > ( GetDlgItem ( IDC_MYLIST ) );
CDC* dc = MyList->GetDC();
MyScoreFile.ReadString ( Name );
MyScoreFile.ReadString ( Score );

MyList->GetWindowRect ( MyListRect );

while ( ScoreRect.Width() < MyListRect.Width() )
{
   Name += " ";
   Final.Format ( "%s%s" , Name , Score );
   dc->DrawText ( Final , ScoreRect , DT_NOCLIP | DT_CALCRECT );
}

MyList->AddString ( Final );


The problem is that the text does not appear taking the whole width of the list box, but rather a small region, about two thirds of the width of the list box. I also tried to use MyList->GetClientRect ( MyListRect ) with the same results.

Thank you very much.

<marquee>

Hosam Aly Mahmoud


GeneralRe: ListBox with Columns Pin
David Crow13-Jun-03 7:38
David Crow13-Jun-03 7:38 
GeneralRe: ListBox with Columns Pin
Hosam Aly Mahmoud14-Jun-03 5:30
Hosam Aly Mahmoud14-Jun-03 5:30 
GeneralRe: ListBox with Columns Pin
David Crow16-Jun-03 2:34
David Crow16-Jun-03 2:34 
GeneralProblem with serial communication Pin
justin22313-Jun-03 6:15
justin22313-Jun-03 6:15 
GeneralLogging Tools for C++ Pin
Anonymous13-Jun-03 6:10
Anonymous13-Jun-03 6:10 
GeneralRe: Logging Tools for C++ Pin
David Crow13-Jun-03 7:40
David Crow13-Jun-03 7:40 
GeneralRe: Logging Tools for C++ Pin
Anonymous13-Jun-03 7:52
Anonymous13-Jun-03 7:52 
GeneralRe: Logging Tools for C++ Pin
David Crow13-Jun-03 8:00
David Crow13-Jun-03 8:00 
GeneralRe: Logging Tools for C++ Pin
Anonymous13-Jun-03 8:57
Anonymous13-Jun-03 8:57 
GeneralRe: Logging Tools for C++ Pin
David Crow13-Jun-03 9:06
David Crow13-Jun-03 9:06 
GeneralRe: Logging Tools for C++ Pin
cmk13-Jun-03 8:03
cmk13-Jun-03 8:03 
GeneralRe: Logging Tools for C++ Pin
Anonymous13-Jun-03 8:58
Anonymous13-Jun-03 8:58 
GeneralRe: Logging Tools for C++ Pin
John M. Drescher13-Jun-03 10:50
John M. Drescher13-Jun-03 10:50 
GeneralDialogBox won't quit Pin
Brigg Thorp13-Jun-03 5:22
Brigg Thorp13-Jun-03 5:22 
GeneralRe: DialogBox won't quit Pin
valikac13-Jun-03 6:25
valikac13-Jun-03 6:25 
Generalresizable columns Pin
hdaly13-Jun-03 5:13
hdaly13-Jun-03 5:13 
GeneralRe: resizable columns Pin
David Crow13-Jun-03 5:27
David Crow13-Jun-03 5:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.