Click here to Skip to main content
16,005,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CPU Usage Pin
Rajesh R Subramanian2-Mar-10 23:32
professionalRajesh R Subramanian2-Mar-10 23:32 
AnswerRe: CPU Usage Pin
Adam Roderick J2-Mar-10 23:37
Adam Roderick J2-Mar-10 23:37 
AnswerRe: CPU Usage Pin
CPallini3-Mar-10 0:06
mveCPallini3-Mar-10 0:06 
AnswerRe: CPU Usage Pin
Moak3-Mar-10 1:55
Moak3-Mar-10 1:55 
AnswerRe: CPU Usage Pin
David Crow3-Mar-10 3:06
David Crow3-Mar-10 3:06 
Questionto change user name of windows Pin
zon_cpp2-Mar-10 23:15
zon_cpp2-Mar-10 23:15 
AnswerRe: to change user name of windows Pin
Rajesh R Subramanian2-Mar-10 23:31
professionalRajesh R Subramanian2-Mar-10 23:31 
QuestionSetting a CToolBar Button's Label to take multiple lines of text Pin
David Ferreira2-Mar-10 22:54
David Ferreira2-Mar-10 22:54 
I've been trying to figure out how to get the buttons on a CToolBar to accept the newline character like a normal button does when you set the multiple line property to true.
Apparently the buttons on a toolbar are not normal buttons so i cant get a handle and there is no multiline style like there is on a normal button.

I've got (this is in a class that inherits CToolBar)
CToolBarCtrl& bar = GetToolBarCtrl();//CToolBar::GetToolBarCrtl
int nIndex = 0;
CRect NoTextRc( 0, 0, 0, 0 );
bar.GetItemRect( 0, NoTextRc );
bar.SetMaxTextRows(3);//sets the max number of rows
bar.SetDrawTextFlags( 0xffffffff,  DT_WORDBREAK);//Should Break line on space and /n


Line 1 gets the toolbarctrl for the toolbar in question
Line 5&6 should make me able to have 3 rows of text and break on a space or a carriage return
What it is doing is just not displaying any text after the space or the /n.
I've made the size of the button really large just incase the button wasn't big enough with

SetSizes(CSize( 120, 100 ), CSize( 90, 36 ));//CToolBar::SetSize


Here is where i set the text of the toolbar
The commented code are failed attempts at making the button multiline in the same mannar as a button

if ( !strButtonText.IsEmpty() ) 
{
    //SetButtonStyle(nIndex,ES_MULTILINE);
    strButtonText.Replace(" ","\r");
    //bar.SetStyle(ES_MULTILINE);
    SetButtonText( nIndex, strButtonText );//CToolBar::SetButtonText	
}


All the above is in a class that inherits CToolBar.
Can anyone please help me out here i've spent way more time than i should on this and i have no solution in sight.
AnswerRe: Setting a CToolBar Button's Label to take multiple lines of text Pin
KarstenK2-Mar-10 23:43
mveKarstenK2-Mar-10 23:43 
GeneralRe: Setting a CToolBar Button's Label to take multiple lines of text Pin
David Ferreira2-Mar-10 23:54
David Ferreira2-Mar-10 23:54 
GeneralRe: Setting a CToolBar Button's Label to take multiple lines of text Pin
KarstenK3-Mar-10 0:36
mveKarstenK3-Mar-10 0:36 
GeneralRe: Setting a CToolBar Button's Label to take multiple lines of text Pin
David Ferreira3-Mar-10 1:14
David Ferreira3-Mar-10 1:14 
GeneralRe: Setting a CToolBar Button's Label to take multiple lines of text Pin
KarstenK3-Mar-10 1:30
mveKarstenK3-Mar-10 1:30 
QuestionHow to compute Islamic prayer time everyday? [modified] Pin
fantasy12152-Mar-10 21:41
fantasy12152-Mar-10 21:41 
AnswerRe: How to compute Islamic prayer time everyday? Pin
Rajesh R Subramanian2-Mar-10 22:47
professionalRajesh R Subramanian2-Mar-10 22:47 
QuestionRe: How to compute Islamic prayer time everyday? Pin
David Crow3-Mar-10 3:14
David Crow3-Mar-10 3:14 
AnswerRe: How to compute Islamic prayer time everyday? Pin
fantasy12153-Mar-10 16:23
fantasy12153-Mar-10 16:23 
GeneralRe: How to compute Islamic prayer time everyday? Pin
Game-point3-Mar-10 19:05
Game-point3-Mar-10 19:05 
QuestionMFC Drag & Drop Between two Tree control [modified] Pin
vkpMark2-Mar-10 20:39
vkpMark2-Mar-10 20:39 
AnswerRe: MFC Drag & Drop Between two Tree control [modified] Pin
SandipG 2-Mar-10 21:14
SandipG 2-Mar-10 21:14 
GeneralRe: MFC Drag & Drop Between two Tree control Pin
vkpMark2-Mar-10 21:50
vkpMark2-Mar-10 21:50 
GeneralRe: MFC Drag & Drop Between two Tree control Pin
vkpMark3-Mar-10 0:37
vkpMark3-Mar-10 0:37 
QuestionwxWidgets and themes Pin
zqueezy2-Mar-10 19:50
zqueezy2-Mar-10 19:50 
QuestionHow To Serailize collection class object Pin
adityarao312-Mar-10 19:45
adityarao312-Mar-10 19:45 
AnswerRe: How To Serailize collection class object Pin
Eugen Podsypalnikov2-Mar-10 20:41
Eugen Podsypalnikov2-Mar-10 20:41 

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.