Here you go dude...
Code: Select all
--- window.cs Mon Jun 14 21:52:00 2004
+++ window.cs Wed Jun 16 18:48:45 2004
@@ -276,7 +276,7 @@
// re-add window to parent, which will place it behind all top-most windows,
// which in either case is the right place for this window
- parent.AddChildImpl(this);
+ origParent.AddChildImpl(this);
OnZChangedImpl();
}
@@ -1258,17 +1258,17 @@
window.Parent.RemoveChild(window);
}
- int position = (ChildCount == 0) ? 0 : ChildCount - 1;
+ int position = (ChildCount == 0) ? 0 : ChildCount;
if(!window.AlwaysOnTop) {
// find last non-topmost window
- while((position != 0) && children[position].AlwaysOnTop) {
+ while((position != 0) && children[position - 1].AlwaysOnTop) {
position--;
}
}
// add window at the end
- if(position == (ChildCount - 1)) {
+ if(position == ChildCount) {
children.Add(window);
}
else {
Also fixes a bug in your AlwaysOnTop property setter.