Click here to Skip to main content
16,010,544 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Colors... Pin
JoeSox12-Jan-03 8:52
JoeSox12-Jan-03 8:52 
GeneralRe: Colors... Pin
Paul Silvernail12-Jan-03 8:47
Paul Silvernail12-Jan-03 8:47 
GeneralRe: Colors... Pin
JoeSox12-Jan-03 8:57
JoeSox12-Jan-03 8:57 
GeneralRe: Colors... Pin
PJ Arends12-Jan-03 9:48
professionalPJ Arends12-Jan-03 9:48 
GeneralJet Database without MFC Pin
Paul Silvernail12-Jan-03 6:49
Paul Silvernail12-Jan-03 6:49 
GeneralRe: Jet Database without MFC Pin
Stefan Pedersen12-Jan-03 7:51
Stefan Pedersen12-Jan-03 7:51 
General(no mfc) Listbox and icons Pin
int01h12-Jan-03 5:01
int01h12-Jan-03 5:01 
Generalcustom control help Pin
paully12-Jan-03 2:46
paully12-Jan-03 2:46 
I'm having a problem trying to get a custom control to respond to OnPaint(). I followed Chris Maunders' Creating Custom Controls tutorial to create the control, great tutorial. Now I am trying to get it to paint the control a different color. I'm using this custom control as part of a tetris clone I am writing. The project is dialog based and this custom control is what I'd like to use for the 'game board'. To test I am using buttons on the dialog where the custom control resides. Just to make sure everything is communicating correctly I used some AfxMessageBox calls to verify. And all the right functions are being called, I just cant get it to paint. The following is in my OnPaint() for the custom control class:
thanks for any help,
paul

void CGameBoard::OnPaint() <br />
{<br />
	CPaintDC dc(this); // device context for painting<br />
	CRect rect;<br />
	<br />
	GetWindowRect(rect);<br />
	ScreenToClient(&rect);<br />
<br />
	dc.FillSolidRect(rect,RGB(35,30,100));<br />
	<br />
}

I first call a Paint() function. It calls Invalidate then calls OnPaint()
void CGameBoard::Paint()<br />
{<br />
	Invalidate();<br />
	OnPaint();	// force an immediately paint<br />
}

GeneralPlay Wave File! Pin
Alex H 198312-Jan-03 2:03
Alex H 198312-Jan-03 2:03 
GeneralRe: Play Wave File! Pin
User 665812-Jan-03 2:14
User 665812-Jan-03 2:14 
GeneralRe: Play Wave File! Pin
Alex H 198312-Jan-03 2:26
Alex H 198312-Jan-03 2:26 
GeneralRe: Play Wave File! Pin
User 665812-Jan-03 2:34
User 665812-Jan-03 2:34 
GeneralRe: Play Wave File! Pin
Ted Ferenc12-Jan-03 2:39
Ted Ferenc12-Jan-03 2:39 
QuestionChange dialog region dynamically?? Pin
Weiye Chen12-Jan-03 1:53
Weiye Chen12-Jan-03 1:53 
AnswerRe: Change dialog region dynamically?? Pin
includeh1013-Jan-03 0:45
includeh1013-Jan-03 0:45 
GeneralError no. 87 when trying to read from a drive... Pin
Redeemer-dk12-Jan-03 1:47
Redeemer-dk12-Jan-03 1:47 
GeneralRe: Error no. 87 when trying to read from a drive... Pin
Mike Nordell12-Jan-03 4:08
Mike Nordell12-Jan-03 4:08 
QuestionHow can I prohibit STL alter its items' addresses? Pin
IMiracle12-Jan-03 1:22
IMiracle12-Jan-03 1:22 
AnswerRe: How can I prohibit STL alter its items' addresses? Pin
geo_m12-Jan-03 3:45
geo_m12-Jan-03 3:45 
GeneralA little help with painting please Pin
georgiek5012-Jan-03 1:11
georgiek5012-Jan-03 1:11 
GeneralRe: A little help with painting please Pin
geo_m12-Jan-03 3:57
geo_m12-Jan-03 3:57 
Generalstruct type redefinition error Pin
boon kian11-Jan-03 22:19
boon kian11-Jan-03 22:19 
GeneralRe: struct type redefinition error Pin
PJ Arends11-Jan-03 22:54
professionalPJ Arends11-Jan-03 22:54 
GeneralRe: struct type redefinition error Pin
Stephane Rodriguez.12-Jan-03 0:00
Stephane Rodriguez.12-Jan-03 0:00 
GeneralRe: struct type redefinition error (thank you) Pin
boon kian12-Jan-03 2:34
boon kian12-Jan-03 2:34 

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.