Click here to Skip to main content
15,913,587 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to change the device context for a status bar Pin
jk chan7-Aug-07 0:01
jk chan7-Aug-07 0:01 
GeneralRe: how to change the device context for a status bar Pin
BlrBoy7-Aug-07 0:08
BlrBoy7-Aug-07 0:08 
AnswerRe: how to change the device context for a status bar Pin
jk chan7-Aug-07 0:28
jk chan7-Aug-07 0:28 
GeneralRe: how to change the device context for a status bar Pin
BlrBoy7-Aug-07 1:06
BlrBoy7-Aug-07 1:06 
GeneralRe: how to change the device context for a status bar Pin
jk chan7-Aug-07 2:12
jk chan7-Aug-07 2:12 
GeneralRe: how to change the device context for a status bar Pin
BlrBoy7-Aug-07 3:18
BlrBoy7-Aug-07 3:18 
GeneralRe: how to change the device context for a status bar Pin
jk chan7-Aug-07 15:01
jk chan7-Aug-07 15:01 
GeneralRe: how to change the device context for a status bar Pin
BlrBoy7-Aug-07 18:05
BlrBoy7-Aug-07 18:05 
You are right... I could achieve drawing background color, but not image. Big Grin | :-D

Here is the code

<br />
void CMyStatusBar::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)<br />
{<br />
	CDC dc;<br />
	dc.Attach(lpDrawItemStruct->hDC);<br />
<br />
	// Get the pane rectangle and calculate text coordinates<br />
	CRect rect(&lpDrawItemStruct->rcItem);<br />
<br />
	switch(lpDrawItemStruct->itemID) {<br />
<br />
		case 0:<br />
			dc.FillSolidRect (rect, RGB (255,255,0));<br />
                        break;<br />


here is the code in mainfrm.cpp in OnCreate () function

for (int i=0; i<4; i++)<br />
{<br />
    // Change Status Bar style to make it Owner-drawn<br />
    m_wndStatusBar.GetStatusBarCtrl().SetText("", i, SBT_OWNERDRAW); <br />
}<br />


Since it is owner draw.. DrawItem is called. but FillSolidRect is getting executed but no change in UI. I tried to use CDC functions like TextOut, rectangle,etc.. UI there is no change.

Can you say why is this behaviour? What went wrong

Thanks for your time.
GeneralRe: how to change the device context for a status bar Pin
jk chan7-Aug-07 19:59
jk chan7-Aug-07 19:59 
GeneralRe: how to change the device context for a status bar Pin
jk chan7-Aug-07 20:05
jk chan7-Aug-07 20:05 
QuestionHow to change a Dialog Form's scrollbar's color? Pin
Peter, Chan6-Aug-07 21:23
Peter, Chan6-Aug-07 21:23 
AnswerRe: How to change a Dialog Form's scrollbar's color? Pin
jk chan6-Aug-07 23:53
jk chan6-Aug-07 23:53 
AnswerRe: How to change a Dialog Form's scrollbar's color? Pin
Hamid_RT7-Aug-07 19:19
Hamid_RT7-Aug-07 19:19 
QuestionHow to save a html file in C#.Net Pin
sundeep.A6-Aug-07 21:20
sundeep.A6-Aug-07 21:20 
AnswerRe: How to save a html file in C#.Net Pin
Jonathan [Darka]6-Aug-07 23:31
professionalJonathan [Darka]6-Aug-07 23:31 
AnswerRe: How to save a html file in C#.Net Pin
Hamid_RT7-Aug-07 19:18
Hamid_RT7-Aug-07 19:18 
QuestionWeb Based Installation Pin
vipin_nvk6-Aug-07 21:03
vipin_nvk6-Aug-07 21:03 
QuestionHow to write partial scanline: TIFF file Pin
vandana76-Aug-07 20:01
vandana76-Aug-07 20:01 
GeneralRe: How to write partial scanline: TIFF file Pin
sunil20046-Aug-07 20:38
sunil20046-Aug-07 20:38 
QuestionCloseHandle Pin
dellthinker6-Aug-07 19:47
dellthinker6-Aug-07 19:47 
AnswerRe: CloseHandle Pin
Paresh Chitte6-Aug-07 19:55
Paresh Chitte6-Aug-07 19:55 
AnswerRe: CloseHandle Pin
Jonathan [Darka]6-Aug-07 23:35
professionalJonathan [Darka]6-Aug-07 23:35 
Questionlinking two projects Pin
valli_guru6-Aug-07 17:55
valli_guru6-Aug-07 17:55 
AnswerRe: linking two projects Pin
User 5838526-Aug-07 18:14
User 5838526-Aug-07 18:14 
GeneralRe: linking two projects Pin
valli_guru6-Aug-07 18:30
valli_guru6-Aug-07 18:30 

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.