locked
Toolbar dock position RRS feed

  • Question

  • HI
    I have developed a graphical application using VC++ (MFC) & VS 2008. There are multiple toolbars that I have defined in the code & also the dock position. When I run the application, and if I change the dock position of any of the toolbars, it remembers that position when I start application next time. I want to force the doct position for these toolbars as defined in the code, everytime I start the application. I have used CMFCToolBars and used DockPane / DockPaneLeftOf to define the start positon in MainFrm.cpp.
    Thanks
    Vivek
    Saturday, October 10, 2009 1:18 PM

Answers

All replies

  • Hello

    Please check out the CDockingManager::LoadState method.

    Regards,
    (rest of form content)
    Monday, October 12, 2009 11:36 AM
  • Hello Vivek

    You can accomplish it by adding one code line into your App class's contructor. For example, my test project is named "Test", I therefore add

    this->m_bSaveState = FALSE;

    to CTestApp::CTestApp()

    This tells the application not to save the state of toolbar and menus when it exits.

    Please let me know whether this works for you.

    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Regards, Jialiang Ge MSDN Subscriber Support in Forum If you have any feedback of our support, please contact msdnmg@microsoft.com. Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, October 23, 2009 11:00 AM
  • Hello Vivek

    How are you ? May I know whether the above solution helped you?
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, October 26, 2009 4:25 AM
  • Hi Jialiang Ge

    Sorry for replying so late. This is because I was involved in another project. Now I am back with the
    product development. What I want is, allow user to decide if he wishes to save the last position of
    of Toolbars. Also, there is one more feature : I am using in my MainFrm, datawindow using CDockablePane.
    Now this window position also is automatically saved by the application. Can I allow user to
    decide ?

    Regards
    Vivek

    Thursday, August 19, 2010 1:56 PM