Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sizing an MFC Control

Posted on 2001-08-13
2
Medium Priority
?
530 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

636 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