Solved

Resizing docked CDialogBar

Posted on 2009-06-28
5
1,453 Views
Last Modified: 2013-11-20
Hi,

I am trying to create resizable CDialogBar which is in docked state. I managed to resize it while it is floating, but i don't want that bar to be floating, only docked and I want to resize it.

Thanks already
0
Comment
Question by:talgraf1
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:alb66
ID: 24733990
Give a look at this good project:

"CSizingControlBar - a resizable control bar"
at
http://www.codeproject.com/KB/toolbars/sizecbar.aspx
0
 

Author Comment

by:talgraf1
ID: 24734228
I inherited a class from CSizingControlBar, but I can't just throw my dialog in it. Also I cannot resize docked bar which was intended.
0
 
LVL 30

Accepted Solution

by:
Zoppo earned 250 total points
ID: 24734907
Hi talgraf1,

to change the size of a CDialogBar (which is calculated from it's underlaying dialog-resource) you can override CControlBar::CalcFixedLayout in your CDialogBar derived class. This sample i.e. just adds 150 pixels to the width of the dialog-bar:

/*virtual*/ CSize
CTestDlgBar::CalcFixedLayout( BOOL bStretch, BOOL bHorz )
{
      CSize s = CDialogBar::CalcFixedLayout( bStretch, bHorz );

      s.cx += 150;

      return s;
}

Hope that helps,

ZOPPO
0
 
LVL 30

Expert Comment

by:Zoppo
ID: 24902508
Hi talgraf1,

did you have any problems with the solution I gave? Didn't it work for you? Or is there any other reason why you accepted it with a 'B'-grade?

ZOPPO
0
 

Author Comment

by:talgraf1
ID: 24968958
Hi Zoppo

I used your solution and noticed that dialogbar was not that I needed -> ran to a dead end. But thanks anyway.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now