More posts! :) CButtons in CViews?
-
Hi all, Is it possible to have CButtons in a CView? And I dont wanna use the dialog editor, i want to create them dynamically. How to I make the m_btn appear in my CView client area? Probably through the use of m_btn.ShowWindow(SW_SHOW) but from where should I call it? Thx, /Tommy
-
Hi all, Is it possible to have CButtons in a CView? And I dont wanna use the dialog editor, i want to create them dynamically. How to I make the m_btn appear in my CView client area? Probably through the use of m_btn.ShowWindow(SW_SHOW) but from where should I call it? Thx, /Tommy
In OnInitialUpdate.
RECT rc = { 10, 10, 100, 100 }; m\_Button.Create("Caption", WS\_VISIBLE | WS\_CHILD, rc, this, 1); m\_Button.ShowWindow(SW\_SHOW);
The 1 is the ID, I suggest creating an ID range in resource.h and using it for dynamically created buttons, then use OnCommand to capture their being pressed. Michael Dunn gave some good advice on how this works in the thread on WTL dynamic buttons I started. Christian #include "std_disclaimer.h" The careful application of terror is also a form of communication. Eagles may soar, but weasels don't get sucked into jet engines.