Monday, May 7, 2007

Windows form Z-Order

An acquaintance on the Boise Software Developers group asked about finding the Z-Order for a control in a windows form last week. After a bit of searching, I found this for him. I figured, I'd put it here for anyone else who might need it:

int i = this.Controls.GetChildIndex(this.Label1);

While I'm not a windows form programmer, this should work. Just iterate through all the controls.

No comments: