熱點推薦:
您现在的位置: 電腦知識網 >> 操作系統 >> Windows優化 >> 正文

C#Windows控件的焦點事件順序

2022-06-13   來源: Windows優化 

  以下是我測試TextBox事件的結果如有不對還望更正
  
  用鼠標點擊控件然後離開
  Enter
  GotFocus
  LostFocus
  Leave
  Validating
  Validated
  
  用鼠標當 Validating 中 CancelEventArgsCancel = true 時
  Enter
  GotFocus
  LostFocus
  Leave
  Validating
  Enter
  GotFocus
  
  用tab鍵經過一個控件時
  Enter
  GotFocus
  KeyUp
  Leave
  Validating
  Validated
  LostFocus
  
  用tab鍵當 Validating 中 CancelEventArgsCancel = true 時
  Enter
  GotFocus
  KeyUp
  Leave
  Validating
  Enter
  KeyUp

From:http://tw.wingwit.com/Article/os/youhua/201311/10753.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.