Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. More posts! :) CButtons in CViews?

More posts! :) CButtons in CViews?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tommy H D Svensson
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • T Tommy H D Svensson

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups