Solved

Preventing the sizing of the CView derived class

Posted on 2000-04-05
4
289 Views
Last Modified: 2013-11-20
I have a CView derived class and i want to restrict sizing of this window till some specific size.

I tried to do this in OnSize() and OnWindowPosChanged() events, but they didn't work.

Can anybody post a few lines of code how to do this?

Thanks.
0
Comment
Question by:Mindo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:captainkirk
ID: 2687023
Is this an MDI or SDI app??

If you want the main frame to remain the same size, you can specify that it can't be resized by turning the WS_THICKFRAME style off in your main frame class' PreCreateWindow() function.
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 50 total points
ID: 2687045
Hi Mindo,

override the WM_GETMINMAXINFO handler CWnd::OnGetMinMaxInfo() for the view's frame window class (the CChildFrame) and set min and max tracking size of the passed MINMAXINFO as you need them.

hope that helps,

ZOPPO
0
 
LVL 3

Expert Comment

by:MDarling
ID: 2687052
You should respond to WM_GETMINMAXINFO.

and set the ptMinTrackSize and ptMaxTrackSize to the same value that
you want your view to be.

regards,
Mike.
0
 
LVL 3

Expert Comment

by:MDarling
ID: 2687056
woah - Zoppo's too quick :)

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

734 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