按顺序输出控件名称

 

           int ob;
            
int a = Controls.Count;
            
int[] tt = new int[a];
            
for (int intindex = 0; intindex < a ; intindex++)
            
...{
                tt[intindex] 
= intindex;
            }

            
for (int j = 1; j < a ; j++)
            
...{
                
for (int i = 0; i < a - 1; i++)
                
...{
                   
if (Controls[tt[i]].Location.Y > Controls[tt[i+1]].Location.Y)
                    
...{
                        ob 
= tt[i];
                        tt[i] 
= tt[i + 1];
                        tt[i 
+ 1= ob;
                    }

                    
else if (Controls[tt[i]].Location.Y == Controls[tt[i + 1]].Location.Y)
                    
...{
                        
if (Controls[tt[i]].Location.X > Controls[tt[i + 1]].Location.X)
                        
...{
                            ob 
= tt[i];
                            tt[i] 
= tt[i + 1];
                            tt[i 
+ 1= ob;
                        }

                    }

                }

            }

            
for (int intindex =0; intindex <a; intindex++)
            
...{
                System.Console.WriteLine(
this.Controls[tt[intindex]].Name);
            }
阅读更多
想对作者说点什么? 我来说一句

java 按相反的顺序输出

2010年06月18日 59KB 下载

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭