0

I tried the following snippet but it doesn't show up:

HICON hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ICON1));
myeditcontrol.SetIcon(hIcon, FALSE);
IInspectable
  • 46,945
  • 8
  • 85
  • 181
Sandeep Kumar
  • 85
  • 1
  • 3
  • 10

1 Answers1

1

The icon associated with a window shows up in the taskbar button, the caption bar, and the Alt+Tab dialog. It is only meaningful for a top-level window.

Calling CWnd::SetIcon for a non top-level window (like a CEdit control) has no effect. If you want to display graphics in an Edit control, you'll have to go with something more capable, like a Rich Edit control (see CRichEditCtrl for an MFC wrapper).

IInspectable
  • 46,945
  • 8
  • 85
  • 181