【VS2017】怎么调整Tab键的顺序和回车直接登录

有时候使用笔记本没有鼠标的时候,大家都会使用Tab键去选择文本框去输入自己的用户名密码,这就产生了一个需求,如何修改Tab键的顺序呢?

怎么调整Tab键的顺序

第一步:点击视图

在这里插入图片描述

第二步:点击如上图的Tab键顺序

此时用鼠标第一次点击的控件就是Tab键第一次按下,焦点的位置。依次设置
在这里插入图片描述

如何实现回车键直接登录

 private void txtPassWord_KeyDown(object sender, KeyEventArgs e)
        {
            this.KeyDown += new KeyEventHandler(txtUserID_KeyDown);


            if (e.KeyCode == Keys.Enter)
            {
                this.Focus();
                btnOK_Click(this, new EventArgs());
            }
        }
发布了202 篇原创文章 · 获赞 34 · 访问量 7万+
展开阅读全文

关于java tab顺序的问题

07-10

本人在界面中设置了很多的控件,想控制tab的顺序。 我使用composite.setTabList(new Control[]{text_name, combo_sex, text_country});语句进行设置。 其中,text_name, combo_sex, text_country为composite中的部件。 但是每次运行到此处抛出异常。 ava.lang.IllegalArgumentException: Argument not valid at org.eclipse.swt.SWT.error(SWT.java:3761) at org.eclipse.swt.SWT.error(SWT.java:3695) at org.eclipse.swt.SWT.error(SWT.java:3666) at org.eclipse.swt.widgets.Widget.error(Widget.java:463) at org.eclipse.swt.widgets.Composite.setTabList(Composite.java:999) at com.hcls.ui.view.dialog.CustomerEditorDialog.createDialogArea(CustomerEditorDialog.java:290) at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760) at org.eclipse.jface.window.Window.create(Window.java:431) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089) at org.eclipse.jface.window.Window.open(Window.java:790) at com.hcls.ui.action.CustomerActionGroup$AddPoteCustomerAction.run(CustomerActionGroup.java:337) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at hcls_icrm.intro.Application.start(Application.java:275) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212) 请各位编程达人给看看这是什么原因? 问答

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

©️2019 CSDN 皮肤主题: 精致技术 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览