Click here to Skip to main content
15,907,910 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question[mfc] start/stop other process Pin
rahuljin22-Jul-09 6:24
rahuljin22-Jul-09 6:24 
AnswerRe: [mfc] start/stop other process Pin
Rajesh R Subramanian22-Jul-09 6:55
professionalRajesh R Subramanian22-Jul-09 6:55 
GeneralRe: [mfc] start/stop other process Pin
rahuljin22-Jul-09 7:23
rahuljin22-Jul-09 7:23 
GeneralRe: [mfc] start/stop other process Pin
Rajesh R Subramanian23-Jul-09 7:50
professionalRajesh R Subramanian23-Jul-09 7:50 
GeneralRe: [mfc] start/stop other process Pin
rahuljin23-Jul-09 9:22
rahuljin23-Jul-09 9:22 
GeneralRe: [mfc] start/stop other process Pin
rahuljin22-Jul-09 10:05
rahuljin22-Jul-09 10:05 
GeneralRe: [mfc] start/stop other process Pin
killabyte22-Jul-09 15:18
killabyte22-Jul-09 15:18 
QuestionHow to set CTabCtrl background colour? Pin
risa0922-Jul-09 4:57
risa0922-Jul-09 4:57 
I have Tabctrl in a dialog.I want to set its background colour for each tab .I tried ON_WM_DRAWITEM but the control never comes in OnDrawItem().Can you help?

#define RED RGB(255,0,0)
#define YELLOW RGB(255,255,0)
#define MAGENTA RGB(255,0,255)
#define WHITE RGB(255,255,255)
#define BLUE RGB(0,0,255)

void CVMListDialog::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpdis)
{
CDialog::OnDrawItem(nIDCtl, lpdis);

char szTabText[100];
RECT rect;
UINT bkColor;
CBrush *cbr;
TC_ITEM tci;

CTabCtrl *pTabCtrl = (CTabCtrl *)GetDlgItem(IDC_TAB_VM);

if (pTabCtrl->m_hWnd == lpdis->hwndItem)
{
// which tab?
switch (lpdis->itemID)
{
case 0:
cbr = &m_brRed;
bkColor = RED;
break;

case 1:
cbr = &m_brYellow;
bkColor = YELLOW;
break;

case 2:
cbr = &m_brMagenta;
bkColor = MAGENTA;
break;

case 3:
cbr = &m_brWhite;
bkColor = WHITE;
break;

case 4:
cbr = &m_brBlue;
bkColor = BLUE;
break;
}

memset(szTabText, '\0', sizeof(szTabText));

tci.mask = TCIF_TEXT;
tci.pszText = szTabText;
tci.cchTextMax = sizeof(szTabText)-1;

pTabCtrl->GetItem(lpdis->itemID, &tci);

CDC *dc = CDC::FromHandle(lpdis->hDC);

dc->FillRect(&lpdis->rcItem, cbr);
dc->SetBkColor(bkColor);

TextOut(lpdis->hDC,
lpdis->rcItem.left,
lpdis->rcItem.top,
tci.pszText,
lstrlen(tci.pszText));
}

}
AnswerRe: How to set CTabCtrl background colour? Pin
omjee26-Nov-09 22:20
omjee26-Nov-09 22:20 
QuestionUser control problem Data bind Pin
beesan22-Jul-09 1:36
beesan22-Jul-09 1:36 
AnswerRe: User control problem Data bind Pin
Cedric Moonen22-Jul-09 2:43
Cedric Moonen22-Jul-09 2:43 
Question[mfc] ip address control Pin
rahuljin22-Jul-09 1:21
rahuljin22-Jul-09 1:21 
AnswerRe: [mfc] ip address control Pin
Adam Roderick J22-Jul-09 2:17
Adam Roderick J22-Jul-09 2:17 
GeneralRe: [mfc] ip address control Pin
rahuljin22-Jul-09 8:01
rahuljin22-Jul-09 8:01 
GeneralRe: [mfc] ip address control Pin
bolivar12322-Jul-09 9:43
bolivar12322-Jul-09 9:43 
GeneralRe: [mfc] ip address control Pin
rahuljin22-Jul-09 10:03
rahuljin22-Jul-09 10:03 
GeneralRe: [mfc] ip address control Pin
bolivar12322-Jul-09 10:20
bolivar12322-Jul-09 10:20 
GeneralRe: [mfc] ip address control Pin
rahuljin22-Jul-09 10:47
rahuljin22-Jul-09 10:47 
GeneralRe: [mfc] ip address control Pin
bolivar12322-Jul-09 11:07
bolivar12322-Jul-09 11:07 
AnswerRe: [mfc] ip address control Pin
Maximilien22-Jul-09 8:17
Maximilien22-Jul-09 8:17 
QuestionDerived classes in MFC Pin
Penfold82121-Jul-09 23:48
Penfold82121-Jul-09 23:48 
AnswerRe: Derived classes in MFC Pin
Code-o-mat22-Jul-09 0:40
Code-o-mat22-Jul-09 0:40 
GeneralRe: Derived classes in MFC Pin
Penfold82122-Jul-09 1:01
Penfold82122-Jul-09 1:01 
GeneralRe: Derived classes in MFC Pin
Code-o-mat22-Jul-09 1:39
Code-o-mat22-Jul-09 1:39 
GeneralRe: Derived classes in MFC Pin
Penfold82122-Jul-09 2:52
Penfold82122-Jul-09 2:52 

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.