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

C / C++ / MFC

 
GeneralRe: MFC command line arguments Pin
Jerry Wang1-Apr-02 5:24
Jerry Wang1-Apr-02 5:24 
GeneralCTreeCtrl Pin
NC1-Apr-02 4:44
NC1-Apr-02 4:44 
GeneralRe: CTreeCtrl Pin
Ravi Bhavnani1-Apr-02 4:48
professionalRavi Bhavnani1-Apr-02 4:48 
GeneralRe: CTreeCtrl Pin
NC1-Apr-02 5:04
NC1-Apr-02 5:04 
GeneralRe: CTreeCtrl Pin
James R. Twine1-Apr-02 5:17
James R. Twine1-Apr-02 5:17 
GeneralRe: CTreeCtrl Pin
Ravi Bhavnani1-Apr-02 9:09
professionalRavi Bhavnani1-Apr-02 9:09 
GeneralRe: CTreeCtrl Pin
NC1-Apr-02 9:58
NC1-Apr-02 9:58 
GeneralRe: CTreeCtrl Pin
Ravi Bhavnani1-Apr-02 10:22
professionalRavi Bhavnani1-Apr-02 10:22 
Yes, you can use DrawText() using the tree control's DC to determine the exact width of the string to be displayed. If you're using MFC, I'd subclass CTreeCtrl and turn this into a method - eg: CMyTreeCtrl::getTextWidth (CString& strDisplay) - that you can conveniently call from anywhere once the tree control is constructed (and has a DC!).

Use the DT_CALCRECT flag to calculate the bounds used by the text. The call will automagically use the correct font currently in use by the tree control.

/ravi

"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
GeneralRe: CTreeCtrl Pin
NC1-Apr-02 10:51
NC1-Apr-02 10:51 
GeneralRe: CTreeCtrl Pin
Ravi Bhavnani1-Apr-02 11:40
professionalRavi Bhavnani1-Apr-02 11:40 
GeneralRe: CTreeCtrl Pin
2-Apr-02 1:42
suss2-Apr-02 1:42 
GeneralRe: CTreeCtrl Pin
Ravi Bhavnani2-Apr-02 5:55
professionalRavi Bhavnani2-Apr-02 5:55 
GeneralRe: CTreeCtrl Pin
NC2-Apr-02 7:26
NC2-Apr-02 7:26 
Generaladd Double to ArrayList in managed code Pin
Ignacio Varas1-Apr-02 4:43
Ignacio Varas1-Apr-02 4:43 
GeneralRe: add Double to ArrayList in managed code Pin
Joaquín M López Muñoz1-Apr-02 4:46
Joaquín M López Muñoz1-Apr-02 4:46 
GeneralRe: add Double to ArrayList in managed code Pin
Ignacio Varas1-Apr-02 4:58
Ignacio Varas1-Apr-02 4:58 
GeneralRe: add Double to ArrayList in managed code Pin
Joaquín M López Muñoz1-Apr-02 5:07
Joaquín M López Muñoz1-Apr-02 5:07 
GeneralDLL Question Pin
#realJSOP1-Apr-02 4:17
professional#realJSOP1-Apr-02 4:17 
GeneralRe: DLL Question Pin
Tim Smith1-Apr-02 4:31
Tim Smith1-Apr-02 4:31 
QuestionHow to detect if ALT key is pressed Pin
sanskypotov1-Apr-02 3:48
sanskypotov1-Apr-02 3:48 
AnswerRe: How to detect if ALT key is pressed Pin
James R. Twine1-Apr-02 5:18
James R. Twine1-Apr-02 5:18 
GeneralGet String from Runtime created listbox Pin
bracoute1-Apr-02 3:42
bracoute1-Apr-02 3:42 
GeneralRe: Get String from Runtime created listbox Pin
Mazdak1-Apr-02 4:33
Mazdak1-Apr-02 4:33 
GeneralWin2000 and VC++ 6.0 problems Pin
Simon Walton1-Apr-02 3:11
Simon Walton1-Apr-02 3:11 
GeneralRe: Win2000 and VC++ 6.0 problems Pin
dazinith1-Apr-02 3:23
dazinith1-Apr-02 3:23 

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.