且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取Windows应用程序中的控件列表

更新时间:2023-12-06 10:42:10

他们会来按照他们添加的顺序形式(比如说设计时间)


仅仅因为控制是最顶层/最左边的控制,并不意味着它被倾倒在表格第一上。 。


您可能可以创建某种排序函数(或使用带有自定义IComparer事物的array.Sort()),它基于.Location控件
They will come in the order that they were added to the form (say durring design time)

Just because the control is top-most/left-most control, does not mean it was dumped down on the form "first".

You could probably create some sort of sort function (or use array.Sort() with a custom IComparer thing) that sorts based on .Location of the Control


嘿Plater,

你能用代码形式的一些例子来解释你所说的话....请....因为我是新编码所以dnt知道很多这个....请帮帮我,
hey Plater,
Can you explain the thing you said with the help of some example in the form of code....please....as i am new into coding so dnt know much abt this....Please help me out,


如果你有一个Control []你可以使用Array.Sort()对它们进行排序,如果你有检查对象位置的自定义IComparer


请参阅:
http://msdn2.microsoft.com/en-us/library/2b9cyk6x.aspx
Well if you have a Control[] you can use Array.Sort() to sort them, and if you have a custom IComparer that examines the .Location of the object

See:
http://msdn2.microsoft.com/en-us/library/2b9cyk6x.aspx