Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Hi all !
I'm currently developing a run-time designer that allows to drag-drop tools and print the final document, But some controls painted over each other and don't respect their z-order, so I needed to paint each control by it's z-order .. How to do that I'm unable to figure it out ?!
(I tried to use "GetChildIndex" but it's not useful)
if there is a .Net or Native way please let me know ..
I'll be so grateful ! ,thanks any way ..
Posted
Updated 5-Feb-12 8:50am
v3
Comments
Sergey Alexandrovich Kryukov 4-Feb-12 17:54pm    
I wonder why? Each time you want to do something unusual, you have to explain why. Who would want to help you with implementing of questionable functionality being not sure it could be useful. What if the original idea is wrong? You need to start from your ultimate goal.
--SA
Mazen el Senih 5-Feb-12 8:53am    
First at all you have to do respect others Ideas and that short hint in my question doesn't give a full picture to what I do ..
Thank you for your comment any way...
BillWoodruff 4-Feb-12 18:23pm    
I believe this question can be dealt with by your understanding the PrintDocument class, and will not require you to be concerned with the z-order of the controls on the screen: after all, what you want to print is only what's on the screen ... right ? Have you considered generating a high-quality screenshot of the relevant area and printing that ?
Mazen el Senih 5-Feb-12 8:47am    
First :
Thank you for your interesting but,
I really tried to do screen shot and that's not working and in other words it's shame to use as a professional programmer..
Second :
I'm developing a templates for printing just like power point does and let user move/configure his items easily ..
Third :
I tried to use "GetChildIndex" method but the same thing happened ,because the "ControlCollection" does not care about z-order..
Mazen el Senih 5-Feb-12 15:16pm    
Hi BillWoodruff !
I apologize hardly .. I was so shocked after reading what 'SAKryukov' wrote as a comment for my first question on my lovely 'code project :)' ..
I repeat I'm very sorry if i harm you in any way ..
I'd like to receive whatever from you with no hurt feelings hope you do accept my apology ..

Your sincerely
Mazen

1 solution

There is no specific way to access the ZOrder in .NET - it is decided by the order in which controls are inserted into the Controls List. You can however use the GetChildIndex[^] and SetChildIndex[^] methods to find / reorganize them.
 
Share this answer
 
Comments
Mazen el Senih 5-Feb-12 8:50am    
thank you for your interest but that's not what I was looking for .. actually I tried GetChildIndex but It's not working for me ..
again thank you for your time ..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900