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. How to put a CRebar or CRebarCtrl in a dialog based application?

How to put a CRebar or CRebarCtrl in a dialog based application?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 Posts 3 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.
  • B Offline
    B Offline
    bin8922
    wrote on last edited by
    #1

    How to put a CRebar or CRebarCtrl in a dialog based application? I my current, I am trying to add a CRebarCtrl into a dialog based application(either modal or modeless). I created the CRebar and also added a Toolbar into it. There is no error, but I cannot see the Rebar. Please reply and tell me what I should do to make the rebar show up. Thanks a lot in advance. I have put the following code in OnInitDialog() if (!m_wndReBar.Create(this)) { AfxMessageBox("Failed to create rebar"); return -1; // fail to create } m_bmap.LoadBitmap(IDB_BITMAP1); m_wndToolBar.CreateEx(this, TBSTYLE_TRANSPARENT | TBSTYLE_FLAT); m_wndToolBar.LoadToolBar(IDR_TOOLBAR1); m_wndReBar.AddBar(&m_wndToolBar,"Main", &m_bmap); Thanks a lot. Bin

    A A 2 Replies Last reply
    0
    • B bin8922

      How to put a CRebar or CRebarCtrl in a dialog based application? I my current, I am trying to add a CRebarCtrl into a dialog based application(either modal or modeless). I created the CRebar and also added a Toolbar into it. There is no error, but I cannot see the Rebar. Please reply and tell me what I should do to make the rebar show up. Thanks a lot in advance. I have put the following code in OnInitDialog() if (!m_wndReBar.Create(this)) { AfxMessageBox("Failed to create rebar"); return -1; // fail to create } m_bmap.LoadBitmap(IDB_BITMAP1); m_wndToolBar.CreateEx(this, TBSTYLE_TRANSPARENT | TBSTYLE_FLAT); m_wndToolBar.LoadToolBar(IDR_TOOLBAR1); m_wndReBar.AddBar(&m_wndToolBar,"Main", &m_bmap); Thanks a lot. Bin

      A Offline
      A Offline
      Antti Keskinen
      wrote on last edited by
      #2

      Dialog windows do not support toolbars. Plain & simple. In order to achieve the thing you need with a dialog, you would need to derive from CDialog and write the toolbar drawing code yourself. A much better way, however, is available, if you care to use it. A dialog can be also implemented as a form. This means that you create a CFrameWnd object, then load the form into it's view area. This allows you to have dialog controls while retaining all the advantages of having a frame window, such as a toolbar, a menu, status bar etc etc. Of course it doesn't look like an 'authentic' dialog, but in many cases, it works much better than some self-derived dialog. There might be some articles handling this issue here on CodeProject, but if you want to trek the route I've given, I suggest you read my article Using views effectively without the doc/view overhead[^]. It gives you the basics on how to create a frame window that contains a form view. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

      B 1 Reply Last reply
      0
      • A Antti Keskinen

        Dialog windows do not support toolbars. Plain & simple. In order to achieve the thing you need with a dialog, you would need to derive from CDialog and write the toolbar drawing code yourself. A much better way, however, is available, if you care to use it. A dialog can be also implemented as a form. This means that you create a CFrameWnd object, then load the form into it's view area. This allows you to have dialog controls while retaining all the advantages of having a frame window, such as a toolbar, a menu, status bar etc etc. Of course it doesn't look like an 'authentic' dialog, but in many cases, it works much better than some self-derived dialog. There might be some articles handling this issue here on CodeProject, but if you want to trek the route I've given, I suggest you read my article Using views effectively without the doc/view overhead[^]. It gives you the basics on how to create a frame window that contains a form view. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

        B Offline
        B Offline
        bin8922
        wrote on last edited by
        #3

        Thanks a lot for your kindly reply and detailed explaination.

        1 Reply Last reply
        0
        • B bin8922

          How to put a CRebar or CRebarCtrl in a dialog based application? I my current, I am trying to add a CRebarCtrl into a dialog based application(either modal or modeless). I created the CRebar and also added a Toolbar into it. There is no error, but I cannot see the Rebar. Please reply and tell me what I should do to make the rebar show up. Thanks a lot in advance. I have put the following code in OnInitDialog() if (!m_wndReBar.Create(this)) { AfxMessageBox("Failed to create rebar"); return -1; // fail to create } m_bmap.LoadBitmap(IDB_BITMAP1); m_wndToolBar.CreateEx(this, TBSTYLE_TRANSPARENT | TBSTYLE_FLAT); m_wndToolBar.LoadToolBar(IDR_TOOLBAR1); m_wndReBar.AddBar(&m_wndToolBar,"Main", &m_bmap); Thanks a lot. Bin

          A Offline
          A Offline
          alex barylski
          wrote on last edited by
          #4

          Maybe refer to the following link :) http://www.codeproject.com/script/comments/forums.asp?msg=141006&forumid=1647&XtraIDs=1647&searchkw=CReBarCtrl&sd=2%2F16%2F1999&ed=5%2F16%2F2004#xx141008xx[^] How do I print my voice mail?

          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