WM_LBUTTONDOWN for edit controls?

  • Thread starter Thread starter sweetjones
  • Start date Start date
  • Tags Tags
    Controls Edit
Click For Summary
SUMMARY

The discussion centers on handling the WM_LBUTTONDOWN message for edit control boxes in Visual Studio 2005 using C++ and MFC. The user successfully implemented focus switching using the Enter key but seeks guidance on setting focus to an edit control when it is clicked with the mouse. The solution involves overriding the appropriate message handler to capture mouse clicks and call the SetFocus() method on the respective edit control. Resources such as codeguru.com and codeproject.com are recommended for further assistance.

PREREQUISITES
  • Understanding of Windows message handling in MFC
  • Familiarity with C++ programming language
  • Experience with Visual Studio 2005 IDE
  • Knowledge of event-driven programming concepts
NEXT STEPS
  • Research how to override the WM_LBUTTONDOWN message in MFC
  • Learn about the SetFocus() method and its usage in edit controls
  • Explore event handling in MFC for mouse events
  • Review examples of focus management in Windows Forms applications
USEFUL FOR

Developers working with MFC in C++, particularly those implementing user interface interactions and focus management in Windows applications.

sweetjones
Messages
44
Reaction score
0
Hi, I have 4 edit control boxes that I need to except the WM_LBUTTONDOWN message to set focus to them when clicked with the mouse. I have the setfocus events working perfectly. I even manipulated the OnOK override event with the "Enter" key to go to the next edit control box when pressed and send the SetFocus() to them. I just need to know how to set the focus to the edit control when the edit control is clicked with the mouse? If you need a scenario of the problem I would be more than happy to give one. I am using VS2005 C++ and MFC. Thanx In Advance!
 
Technology news on Phys.org
I suggest
you can go to the codeguru.com or codeproject.com to post these question on their forums.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
998
  • · Replies 2 ·
Replies
2
Views
1K
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
21
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
1
Views
1K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K