?
Solved

Sizing an MFC Control

Posted on 2001-08-13
2
Medium Priority
?
526 Views
Last Modified: 2013-11-20
Designing an MFC control, and in the OnSize event attempting to limit the height of the control. But when i run the control in VB the sizing boxes dont snap back to restrict the size.

- Tried subclassing (overriding IsSubclassedControl), didnt make any difference.
- Tried SetWindowPos and SetControlSize. Worked in ActiveX test container but not in VB.

Thanks
Simon
0
Comment
Question by:sdjefferies
[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 Comments
 

Author Comment

by:sdjefferies
ID: 6379884
Found a solution by using the OnDraw event. Not sure if this is the correct method, but it works.

How do i remove the width and height properties? so its a fixed size control?
0
 
LVL 1

Accepted Solution

by:
mupchu777 earned 45 total points
ID: 6434527
You can't remove the width and height properties as they are part of all controls (all controls are windows and all windows have a height and a width property).  The solution in OnDraw is probably what I would recommend and is probably correct.  Im not sure if the control is a owner draw control.  If it is use the OnMeasureItem event.  This event is called initially by the parent window to size controls.  I hope this helps.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses

770 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