Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Preventing the sizing of the CView derived class

Posted on 2000-04-05
4
Medium Priority
?
292 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 200 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

688 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