473,804 Members | 3,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Window Form, Panel, can't set ZOrder at run time/design time

I'm using VS 2005, .net 2.0 for a desktop application (Window Form app).

I can't set ZOrder of Panel control neither at design time by toolbar/menu
command "Bring to Front"/"Sent to Back" nor at run time by calling
BringToFront method of panel. And Panel control doesn't support SetTopLevel
method etc. I tried this while Dock=Fill and Dock=None but its not working at
all.

Please tell me how can I change Panel's ZOrder specially at run time, I have
to show different panels at different times. Is there any way to do this or I
have to set their Visible to true/false to achieve this.
Nov 20 '06
12 9138
Marc,
Thanks for staying to resolve the problem. I indentified the problem,
actually I while dropping panels on form I dropped one on top of other that
causes one to be child of other that is why its not coming front of its
parent.
regards,
Adil

"Marc Gravell" wrote:
Still works fine for me... Have you any code that demonstrates this?

using System;
using System.Windows. Forms;
using System.Drawing;
class Program
{
static void Main()
{
using (Form form = new Form())
using (SplitContainer sc = new SplitContainer( ))
{
sc.Panel1.BackC olor = Color.Red;
sc.Panel2.BackC olor = Color.Blue;
AddPanels(sc.Pa nel1);
AddPanels(sc.Pa nel2);
sc.Dock = DockStyle.Fill;
form.Controls.A dd(sc);
Application.Run (form);
}

}

private static void AddPanels(Split terPanel panel)
{
for (int i = 0; i < 5; i++)
{
Panel p = new Panel();
Button b = new Button();
b.Location = new System.Drawing. Point(10 * i, 10 * i);
b.Click += delegate
{
p.SendToBack();
};
b.Text = "Panel " + i.ToString();
p.Dock = DockStyle.Fill;
p.Controls.Add( b);
panel.Controls. Add(p);
}
}
}

Marc
Nov 21 '06 #11
Glad you resolved it.

As a future guide, if you see this again have a look at the document outline
([Ctrl]+[Alt]+T) - makes it easy to see what nests where.

Marc
Nov 21 '06 #12
Marc,
Thanks its very helpful to view controls outline.

regards,
Adil

"Marc Gravell" wrote:
Glad you resolved it.

As a future guide, if you see this again have a look at the document outline
([Ctrl]+[Alt]+T) - makes it easy to see what nests where.

Marc
Nov 21 '06 #13

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

Similar topics

5
4171
by: Yang Li Ke | last post by:
Hi guys, let's say I want to load a window behind the main window. how do i do it? because right now everytime i do it the main window gets behind and the new window get the focus. Thank you.
2
3009
by: rawCoder | last post by:
Hi I am having this InvalidOperationException with message Cannot call Invoke or InvokeAsync on a control until the window handle has been created This is raised when i try to invoke a method with arguments I need to do this as the method is being called Asynchronously from elsewhere using delegate's BeginInvoke method. The form is well created/initialized yet the messages states otherwise.
1
11591
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
37
2094
by: Geoff Jones | last post by:
Hi Suppose I have two forms: Form1 and Form2. I create and show an instance of Form2 in the code of Form1 e.g. Dim myForm2 = New Form2 myForm2.Show() How do I tell myForm2 that Form1 is its parent? That is, when I look at either "Parent" or "ParentForm" in Form2, they both show "Nothing".
9
4635
by: Quina | last post by:
Hi. Is there someone that can tell me how can I have multiple screens on the the same form, displaying only on at the time? Thank you all for any replys. João Carias
0
883
by: Larry Charlton | last post by:
Is there a way to make a Panel (or other control that can contain child controls) so that it will size correctly at design time (based on CSS)? Panel seems to be doing something weird at design time. I have a CSS with a class .test { width: 40em } for example. If I drop a Panel on the page, Clear the Width, Height and set CssClass to test, and put styleSheetTheme in, the rendered size of the panel doesn't change at design time (works...
4
16270
by: Mikus Sleiners | last post by:
I can't seem to add new controls to form that is inherited from another form. I have BaseForm wich have table layout on it 2 panelsm and some buttons. Now i create InheritedForm : BaseForm and want to add some new controls and add them to pannels but i can't drag and drop them ... designer does not allow me. Why is that ? Panels and table layout modifiers is set to public.
4
4367
by: iKiLL | last post by:
Hi All I am Developing in C# with VS2005. I am Developing a Windows Mobile Forms Application with the CF2 My problem is that when the Input panel is displayed my screen does not
2
596
by: Jonathan Boivin | last post by:
Hi people, Let me introduce to how I get this error. I have a form which load all my bills representation depending upon filters which each bill is a usercontrol of my own having some textboxes containing bill's datas. (I already replaced the labels by painting the text instead.) When I click on my filter button, it clears the current usercontrol bills and load the new ones upon the current chosen filters. The bug happens when
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10075
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.