大写锁定为默认值 [英] Caps Lock as a Default

查看:73
本文介绍了大写锁定为默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我希望将所有数据输入到我的数据库中的所有大写字母作为默认值。有没有办法解决这个问题?


马丁DH

Hello,

I would like to have all data entered into every form in my database in all capital letters as a default. Is there a way to go about this?

martin DH

推荐答案

对不起,不知道怎么回事去做这个。我想知道你是否可以检索大写锁定的状态并发送它,如果它没有打开。但同样,我不知道该怎么做。也许其他人可以提供帮助。但是我想你可以有一个打开和关闭的复选框,无论控件是否在After Update事件中大写字符串。
Sorry, don''t know of a way to do this. I''m wondering if maybe you could retreive the status of the Caps Lock and send it if it''s not on. But again, I don''t know how to do this. Maybe someone else will be able to help. But I suppose you could have a checkbox that turns on and off whether or not the control capitalizes the string in the After Update event.


KeyPress事件

当表单或控件具有焦点时,用户按下并释放与ANSI代码对应的键或键组合时,会发生KeyPress事件。如果通过使用宏中的SendKeys操作或Visual Basic中的SendKeys语句将ANSI键击发送到窗体或控件,也会发生此事件。

Private Sub object_KeyPress(KeyAscii As Integer)

对象表格或表单上控件的名称。

KeyAscii 返回数字ANSI键代码。 KeyAscii参数通过引用传递;更改它会向对象发送不同的字符。将KeyAscii参数设置为0将取消击键,以便对象无法识别按键被按下。
KeyPress Event
The KeyPress event occurs when the user presses and releases a key or key combination that corresponds to an ANSI code while a form or control has the focus. This event also occurs if you send an ANSI keystroke to a form or control by using the SendKeys action in a macro or the SendKeys statement in Visual Basic.

Private Sub object_KeyPress(KeyAscii As Integer)
Object "Form" or the name of a control on a Form.

KeyAscii Returns a numeric ANSI key code. The KeyAscii argument is passed by reference; changing it sends a different character to the object. Setting the KeyAscii argument to 0 cancels the keystroke so that the object doesn''t recognize that a key was pressed.



您可以为数据库中的每个表单设置此项。这可能有点费力,但我不知道有任何其他方法。

You can set this up for every form in your database. It''s a little laborious maybe, but I''m not aware of any other way of doing it.



你好,


我希望将所有数据输入到我的数据库中的所有大写字母作为默认值。有没有办法解决这个问题?


马丁DH
Hello,

I would like to have all data entered into every form in my database in all capital letters as a default. Is there a way to go about this?

martin DH



不要以为可以做到,但是您可以做的是通过将此代码复制到每个表单上每个文本框的KeyPress()事件中,强制所有小写字母在您输入的文本框中自动输入为大写。其他控制类型可能必须以不同方式处理。正如NeoPa所说,它只是有点费力但不荒谬。

Don''t think it can be done, but what you can do is force all lower case letters to be automatically entered as UPPERCASE in your Text Boxes as you type by copying this code into the KeyPress() Event of every Text Box on every Form. Other Control Types may have to be handled differently. As NeoPa stated, it would be just a little laborious but not ridiculous.

展开 | 选择 | Wrap | 行号


这篇关于大写锁定为默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆