Click here to Skip to main content
15,894,740 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionUpdate only a part of a View with OnUpdateAllViews 2nd ! Pin
CrocodileBuck12-Jul-08 2:05
CrocodileBuck12-Jul-08 2:05 
AnswerRe: Update only a part of a View with OnUpdateAllViews 2nd ! Pin
Prasann Mayekar12-Jul-08 3:41
Prasann Mayekar12-Jul-08 3:41 
GeneralRe: Update only a part of a View with OnUpdateAllViews 2nd ! Pin
CrocodileBuck12-Jul-08 4:09
CrocodileBuck12-Jul-08 4:09 
GeneralRe: Update only a part of a View with OnUpdateAllViews 2nd ! Pin
CrocodileBuck12-Jul-08 4:11
CrocodileBuck12-Jul-08 4:11 
QuestionRe: Update only a part of a View with OnUpdateAllViews 2nd ! Pin
David Crow12-Jul-08 7:38
David Crow12-Jul-08 7:38 
Questionstring table error Pin
erfi12-Jul-08 1:20
erfi12-Jul-08 1:20 
AnswerRe: string table error Pin
Bram van Kampen12-Jul-08 13:58
Bram van Kampen12-Jul-08 13:58 
QuestionCBitmapbutton Behaviour Pin
AnithaSubramani12-Jul-08 0:10
AnithaSubramani12-Jul-08 0:10 
Dear All,

I have some problem in displaying the Cbitmatbutton during the SetFocus and KillFocus event. Interestingly, if I disable the bitmapbutton and load the bitmap then it is working fine. If I didnt use the Enablewindow method then the bitmap is not loaded correctly.

But when I use the Enablewindow method in PreTranslateMessage() I have some other problem, that is I need to change the bitmap when pressing the Enter key in the button. If I disable the window and change means it is working but the keyboard event is not accepted after I disble and enable after pressing the enter key. This means that I cannot use the keyboard inputs after pressing the enter key. Please refer the below code:

My exact requirement is that, I need to change the bitmap of the button on Lostfocus, Killfocus and while pressing Enter key.


BOOL CdfdgDlg::PreTranslateMessage(MSG *pMsg) 
{ 
	 if((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN))
	 {
		 CWnd* pWnd = GetFocus();
		 int CtrlID = pWnd->GetDlgCtrlID();
		if(CtrlID==IDC_BUTTON4)
			{
				m_button4.EnableWindow(false);
				m_button4.LoadBitmaps(IDB_BITMAP4,IDB_BITMAP4,NULL,NULL);
				m_button4.EnableWindow(true);
				return TRUE;
			}
		
	 }
 
	 return CDialog::PreTranslateMessage(pMsg); 
} 

void CdfdgDlg::OnBnKillfocusButton4()//Method for Lost focus
{
	// TODO: Add your control notification handler code here
	m_button4.EnableWindow(false);
	bool val=m_button4.LoadBitmaps(IDB_BITMAP1,NULL,IDB_BITMAP1,NULL);
	m_button4.EnableWindow(true);
}

void CdfdgDlg::OnBnSetfocusButton4()//Method for Setfocus
{
	// TODO: Add your control notification handler code here
	m_button4.EnableWindow(false);
	bool val=m_button4.LoadBitmaps(IDB_BITMAP2,NULL,IDB_BITMAP2,NULL);
	m_button4.EnableWindow(true);
	m_button4.SetFocus();
}

AnswerRe: CBitmapbutton Behaviour Pin
Gary R. Wheeler12-Jul-08 3:16
Gary R. Wheeler12-Jul-08 3:16 
GeneralRe: CBitmapbutton Behaviour Pin
AnithaSubramani14-Jul-08 4:46
AnithaSubramani14-Jul-08 4:46 
GeneralRe: CBitmapbutton Behaviour Pin
Gary R. Wheeler14-Jul-08 9:37
Gary R. Wheeler14-Jul-08 9:37 
Questiontab controls in vc++ Pin
ani_ikram11-Jul-08 22:50
ani_ikram11-Jul-08 22:50 
AnswerRe: tab controls in vc++ Pin
sudhir_Kumar11-Jul-08 23:04
sudhir_Kumar11-Jul-08 23:04 
GeneralRe: tab controls in vc++ Pin
ani_ikram11-Jul-08 23:11
ani_ikram11-Jul-08 23:11 
GeneralRe: tab controls in vc++ Pin
sudhir_Kumar11-Jul-08 23:28
sudhir_Kumar11-Jul-08 23:28 
GeneralRe: tab controls in vc++ Pin
tkondal12-Jul-08 9:39
tkondal12-Jul-08 9:39 
Questionpls help newbi MFC VC++ reading from MDB Pin
GPat2411-Jul-08 22:21
GPat2411-Jul-08 22:21 
QuestionHow can fix size of SDI type application? Pin
Le@rner11-Jul-08 20:23
Le@rner11-Jul-08 20:23 
AnswerRe: How can fix size of SDI type application? Pin
sudhir_Kumar11-Jul-08 23:02
sudhir_Kumar11-Jul-08 23:02 
AnswerRe: How can fix size of SDI type application? Pin
krmed12-Jul-08 3:28
krmed12-Jul-08 3:28 
QuestionPrint Preview on SDI splitter application. Pin
Le@rner11-Jul-08 19:07
Le@rner11-Jul-08 19:07 
QuestionUnhandled exception at 0x5d0f0892 in Demo.exe: 0xC0000094: Integer division by zero. Pin
Le@rner11-Jul-08 18:22
Le@rner11-Jul-08 18:22 
AnswerRe: Unhandled exception at 0x5d0f0892 in Demo.exe: 0xC0000094: Integer division by zero. Pin
Cedric Moonen11-Jul-08 22:51
Cedric Moonen11-Jul-08 22:51 
Questionc code for image scaling Pin
md shafaeat hossain11-Jul-08 18:21
md shafaeat hossain11-Jul-08 18:21 
AnswerRe: c code for image scaling Pin
Sameerkumar Namdeo11-Jul-08 18:59
Sameerkumar Namdeo11-Jul-08 18:59 

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.