473,395 Members | 2,468 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,395 software developers and data experts.

Reserving an area of client form

I've created a menu control which is derived from UserControl. This control docks at the top of the form and even checks to make sure that it docks above any other items on the form. The control is 23 pixels high so a control on the form which may have been at location (0,0) before end up getting its location changed to (0,23). Is there a way for my control to reserve or take control of the top 23 pixels of the form? Ideally, I'd like for the other controls to maintain their perception of their coordinates so that the control that used to be at (0,0) still shows a location of (0,0) when inspected. Is this possible

The problem that I have is that if I go back to the moved control and change its location back to (0,0) then my menu won't dock at the top anymore (now it docks next to the control)

To make my control dock at the top of the form I use this code in the constructor
this.Dock = DockStyle.Top

and I use this code in the paint event
if (this.Parent.Controls.GetChildIndex(this) != 1)

this.Parent.Controls.SetChildIndex (this,1)
Any help would be appreciated. Thanks.
Nov 16 '05 #1
1 1150
Reposting to a broader group

----- Rhy Mednick wrote: ----

I've created a menu control which is derived from UserControl. This control docks at the top of the form and even checks to make sure that it docks above any other items on the form. The control is 23 pixels high so a control on the form which may have been at location (0,0) before end up getting its location changed to (0,23). Is there a way for my control to reserve or take control of the top 23 pixels of the form? Ideally, I'd like for the other controls to maintain their perception of their coordinates so that the control that used to be at (0,0) still shows a location of (0,0) when inspected. Is this possible

The problem that I have is that if I go back to the moved control and change its location back to (0,0) then my menu won't dock at the top anymore (now it docks next to the control)

To make my control dock at the top of the form I use this code in the constructor
this.Dock = DockStyle.Top

and I use this code in the paint event
if (this.Parent.Controls.GetChildIndex(this) != 1)

this.Parent.Controls.SetChildIndex (this,1)
Any help would be appreciated. Thanks.
Nov 16 '05 #2

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

Similar topics

7
by: Cues Plus | last post by:
Hello, I have a simple form text area for people to add comments in. The problem is that using the standard <TEXT AREA NAME="comments" ROWS=4 COLS=35></TEXT AREA> Allows people to put in...
1
by: subash | last post by:
Hi All how to create controls in non-client area of forms or usercontrol.Can any one help in getting information on this or solution for this. regards subash
2
by: phil cunningham | last post by:
When I create a simple form I can draw from 0,0 to 300,300 and the whole line appears on screen. When I add a toolbar the same line now goes underneth the toolbar. How do I add a tool bar by...
13
by: Lars Netzel | last post by:
Hi! I have a round area which I want to be able to move the mouse over and fire off events... how do I do that? I have drawn a FillPie Graphics and I feel that there has to be a way of...
5
by: Matthew Hood | last post by:
Here's a interesting question for the guru's out there. I've created a VB.NET class library with a couple of forms that I have successfully got to work from within MS Access using COM interop and...
3
by: teslar91 | last post by:
I need to display a tiled image in the MDI container form's client area, and also detect right-clicks in that area. How do you do that? So far, I've unsuccessfully tried: 1) Placing my image...
3
by: Harry_Crow | last post by:
I wanted to change the Non client area height. This was not possible in the existing Form TitleBar. So I set the FormBorderStyle= None and I calculated and introduced the Non Client area myself. So...
2
by: steve | last post by:
I have a configuration file where I save the size of the client area when my application last run. I would like to be able to set the size of the form's client area at start up to this value but if...
10
by: peepoohead7 | last post by:
How do I put a control on the non-client area of a form? Can a component be painted onto the non-client area? (Bounds)
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.