---
title: "回车转Tab"
author: "weeson"
date: "2011-12-09T18:06:42Z"
tags: []
categories: ["编程语言"]
slug: "tab"
draft: false
lastmod: "2011-12-09T18:06:42Z"
id: 1300159
url: "https://weeson.iteye.com/blog/1300159"
---

原来一直是为每个文本框的KeyPress增加：        if(e.KeyChar = '/r')  SendKeys.Send("{TAB}"); 最近想想，其实有更简单的方法，把Form的KeyPreView设为true，然后在Form的KeyPress中增加下列代码即可：       if (e.KeyChar == '/r')       this.SelectNextControl(this.ActiveControl, true, true, true, true);