473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Resizing a form by its viewable area

If I have a UserControl of fixed size and I want to place it on a blank
form, then resize the form according to the size and shape of the
UserControl, how do I set that height/width on the form without it all
getting messed up by the form's title bar and border?

Or are height and width on Form objects not affected by the border and title
bar?

Jon
Nov 15 '05 #1
2 8968
The Size property of the form is the overall size of the form rectangle,
including titlebar and frame area.
The ClientSize property is just the inner "workspace" area of the form.

So, in this case, just change the values of the ClientSize property to the
values the UserControl wants.

-Rob [MVP]

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
If I have a UserControl of fixed size and I want to place it on a blank
form, then resize the form according to the size and shape of the
UserControl, how do I set that height/width on the form without it all
getting messed up by the form's title bar and border?

Or are height and width on Form objects not affected by the border and title bar?

Jon

Nov 15 '05 #2
Exactly what I needed, thank you!

Jon
"Rob Teixeira [MVP]" <RobTeixeira@@msn.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
The Size property of the form is the overall size of the form rectangle,
including titlebar and frame area.
The ClientSize property is just the inner "workspace" area of the form.

So, in this case, just change the values of the ClientSize property to the
values the UserControl wants.

-Rob [MVP]

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
If I have a UserControl of fixed size and I want to place it on a blank
form, then resize the form according to the size and shape of the
UserControl, how do I set that height/width on the form without it all
getting messed up by the form's title bar and border?

Or are height and width on Form objects not affected by the border and

title
bar?

Jon


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: F. Da Costa | last post by:
Hi all, I'm looking for a way to actually show a selected row *in* the viewable area on the screen. Situation: 1. Large table with autoComplete search fuctionality 2. On clickin a button (or...
3
by: Ken | last post by:
Is it possible to freeze a column/field on a continuous form? Ken
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
1
by: Nikhil Patel | last post by:
Hi all, I dynamically create new controls and display them on the form. My problem is that the user has to resize form manually to see controls whose location property points to a point outside...
12
by: Søren Reinke | last post by:
Hi there I have a little problem. How do i make sure that a graph is not redrawn while the form with the graph is being resized ? I have tried to add a mouse up/down event handler on the...
11
by: Sharon | last post by:
I'm writing a new control derived from UserControl. I need to get an event when the control is done resizing. I tried the Resize, SizeChanged, Move and the Layout events and I also tried to...
11
by: BobAchgill | last post by:
The needed capability: I guess there are two possibilities for making "hot spots" on a Windows Form: The Scenario: I have a world map as the form background. I need clickable hotspots over...
0
by: Mike | last post by:
Hi,I was wondering if it is possible to change the way a datagrid scrolls. I would really like to be able to do the following: 1) remove the vertical scrollbar / prevent one from appearing. 2)...
6
by: tomasio | last post by:
Dear NG, years have passed and I am still more designer than programmer. I build a new version of my website which has a few nasty bugs, especially on my startpage: Resizing text brakes the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.