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

x
?
Solved

How to Disable user resizing of a form?

Posted on 2003-11-05
3
Medium Priority
?
1,617 Views
Last Modified: 2007-12-19
I have an application that at one point, pops up a custom window that has GDI+ drawings on it, based on the content of the first window.  I'm trying to disable the ability of the user to resize and relocate this form in an attempt to eliminate events that would cause a redraw, but I can't find any property of a Windows form that would allow you to lock a window size and position.  Any ideas?  Thanks in advance.
0
Comment
Question by:AlexSilverman
[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
3 Comments
 
LVL 2

Accepted Solution

by:
smitty22 earned 750 total points
ID: 9689831
Set the FormBorderStyle property to one of the "Fixed" values.  That will disable resizing of the form.  I'm not sure how you can lock in its position.
0
 
LVL 6

Expert Comment

by:purpleblob
ID: 9690264
The obvious answer to this would the be to simply set the FormBorderStyle to None but ofcourse this removes the caption bar and borders. Is this what you are after ?

If you want to keep the borders and/or caption then you could set the FormBorderStyle to FixedDialog and set the MinimizeBox and MaximizeBox to False. Now you can still move the form but not resize. Now with stopping the form moving, obviously the Move event is no good as this is after the move has taken place.

You could override the WndProc and catch the WM_NCHITTEST (0x0084) but then you have to handle whether the caption button button(s) have been pressed etc.

Hope this helps
0
 

Author Comment

by:AlexSilverman
ID: 9692032
Thanks to both of you.  It turns out that I don't need to lock the window position, so points go to Smitty.  Congrats.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

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