winform 기술 - 창 떨림 코드

1805 단어
 private void shakeWindow()
 {
  int x = this.getX();
  int y = this.getY();
  
  for (int i = 0; i < 35; i++)
  {
        if ((i % 2) == 0) {
            x += 5;
            y += 5;
        } else {
           x -= 5;
           y -= 5;
        }
       this.setLocation(x, y);
       try {
         Thread.sleep(40);
        } catch (InterruptedException e1) {
          e1.printStackTrace();
       }
     }
 }

좋은 웹페이지 즐겨찾기