473,804 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Z-Order: How to determine and then persist?

I've developed a WinForms application that allows users to create a number
of child forms within a larger parent form. The child forms can be dragged
around within the bounds of the parent. They can also be resized.

When the user closes the application, I want the size and position of the
child forms to be persisted. I've figured out how to do this. The only thing
I'm lacking is the z-order. How do I determine the z-order of each child
form relative to its siblings? If I could find a way to persist this
information, then when the app starts up again, I could arrange the forms
with the same z-order that the user used in the previous session.

Thanx..
Dec 28 '05 #1
3 1478
The ActiveForm will always be on top - so when you close your application
just record the activeform's order as you close them - hope it makes sense.
"Jules Winfield" wrote:
I've developed a WinForms application that allows users to create a number
of child forms within a larger parent form. The child forms can be dragged
around within the bounds of the parent. They can also be resized.

When the user closes the application, I want the size and position of the
child forms to be persisted. I've figured out how to do this. The only thing
I'm lacking is the z-order. How do I determine the z-order of each child
form relative to its siblings? If I could find a way to persist this
information, then when the app starts up again, I could arrange the forms
with the same z-order that the user used in the previous session.

Thanx..

Dec 28 '05 #2
Jules,

The Z-Order is controlled by the order of the controls in the parent
control's Control collection. As long as you serialize out and then
back in with the same order, the Z-Order should be preserved.

See this post:
http://groups.google.com/group/micro...a1a662a032356/

-- Tim Scott
http://geekswithblogs.net/tscott

Dec 29 '05 #3
Thanks -- that's precisely what I was looking for!

"Tim Scott" <ti******@gmail .com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Jules,

The Z-Order is controlled by the order of the controls in the parent
control's Control collection. As long as you serialize out and then
back in with the same order, the Z-Order should be preserved.

See this post:
http://groups.google.com/group/micro...a1a662a032356/

-- Tim Scott
http://geekswithblogs.net/tscott

Dec 29 '05 #4

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

Similar topics

1
6936
by: Angus B. Atkins-Trimnell | last post by:
Hello all, I am curious as to whether there is a way to use ZOrder or SetChildIndex in MS Access (VBA) to place one control at the top of the Z order for the form (or its layer within the form) at runtime. I've been scanning online documentation for an API to add to my code to access either of these functions, but the search has been fruitless thus far. Any help would be greatly appreciated.
1
3000
by: scj | last post by:
Hi all, I need to determine the exact type of DateTime column(*) in an Access 97 database. I'm able to do this with an Access 2 database. With ADO.Net and VB.Net (**), I do something like this : Dim oDT As New DataTable() Dim oCnx As OleDbConnection
1
6134
by: Robert W. | last post by:
I'm trying to dynamically add some controls onto a Tab page and am encountering a strange phenomenon that I'd like to get some feedback on. Here's the guts of the code that I'm using: Button newButton = new Button(); this.Controls.Add(newButton); newButton.Parent = tabPageSummary; newButton.BringToFront();
3
2731
by: Mike Hardy | last post by:
Hi, I have a page with dropdown menus in layers. In this page there is also a IFrame loading another page with some combobox in it. My problem is this, when I hover on my menu to show the dropdown the combobox is on top of the layer. Is there a way to have the layer on top of the combobox? I have provided a link to a picture so you can see the problem.
2
1247
by: Hefty | last post by:
Hi folks, I've created a custom control which consists of a textbox,calendar control and button. User clicks button and chooses date from calendar which in turn populates the textbox. Nothing to taxing there! However, the problem I have is the calendar ctl is always rendered behind existing controls on a form. Which is pretty pointless really. I have set the ZOrder properties accordingly to no aviail.
1
3735
by: Franck | last post by:
Is it possible to prevent the change of the zorder of several forms ? I would like to choose a zorder of severals forms and lock this zorder, even if I click on these forms.
12
9139
by: Adil Akram | last post by:
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...
11
4317
by: =?Utf-8?B?UGFyYWcgR2Fpa3dhZA==?= | last post by:
Hi All, I have a large recordset to be displayed on a ASP 3.0 page. I am using recordset paging for this. For the next and previous link i am passing href as <a href=<Page URl>?page=<%= iPageCurrent - 1 %for Previous. Now when i display the contents i also add a checkbox (for deletion) to each of the records. Now user should be able to select one or more checkboxes across pages and then should be allow to delete all selections together....
4
8459
by: akynaya | last post by:
i have a problem regarding resizing of images that is to be displayed using the picture box. i also have a problem about the dragging and dropping method because the images tend to drag to a different location. this is my drag n drop code: Private Sub Picture28_DragDrop(Source As Control, X As Single, Y As Single) If X > X1 Then Source.Left = Source.Left + (X - X1) Else Source.Left = Source.Left - (X1 - X) If Y > Y1 Then...
0
9595
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
10603
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...
1
10356
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10099
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...
1
7643
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
6869
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();...
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
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.