复选框和选项组 [英] Checkboxes and Option Groups

查看:95
本文介绍了复选框和选项组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解决复选框的标签和选项

组中的选项标签?当复选框获得焦点时,Access会在标签周围绘制一个虚线

框。当选项组获得焦点时,Access会在第一个选项的标签或先前选择的选项

的标签周围绘制一个

虚线框。我想将这些标签的背景颜色更改为

黄色,因为控件得到了重点。


对于文本框和组合框我有一个函数,代码如下:

功能HiLiteControl()

Screen.ActiveControl.Backcolor =" 8454143"

结束功能


我把以下内容放在所有文本框的GotFocus事件中,并且

组合框:

= HiLiteControl()


我希望能够为标签创建类似的复选框

和选项组中选项的标签。


谢谢!


史蒂夫

How can the label for a checkbox and the labels for the options in an option
group be addressed? When a checkbox gets the focus, Access draws a dotted
box around the label. When an option group gets the focus, Access draws a
dotted box around the label of the first option or the label of the option
previously selected. I would like to change the backcolor of these labels to
yellow as the controls get focus.

For textboxes and comboboxes I have a function with the following code:
Function HiLiteControl()
Screen.ActiveControl.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl()

I would like to be able to do something similar for the label for a checkbox
and the labels for the options in an option group.

Thanks!

Steve

推荐答案

PC数据表写道:
标签怎么样选中一个复选框,并解决
选项组中选项的标签?当复选框获得焦点时,Access
会在标签周围绘制一个虚线框。当选项组获得
焦点时,Access会在第一个选项
的标签或先前选择的选项的标签周围绘制一个虚线框。我想将这些标签的背景颜色改为黄色,因为控件会聚焦。
对于文本框和组合框我有一个函数,代码如下:功能HiLiteControl( )
Screen.ActiveControl.Backcolor =" 8454143"
结束功能

我把以下内容放在所有文本框的GotFocus事件和
组合框中:
= HiLiteControl()

我希望能够为
复选框的标签和选项组中的选项标签做类似的事情。

谢谢!

史蒂夫
How can the label for a checkbox and the labels for the options in an
option group be addressed? When a checkbox gets the focus, Access
draws a dotted box around the label. When an option group gets the
focus, Access draws a dotted box around the label of the first option
or the label of the option previously selected. I would like to
change the backcolor of these labels to yellow as the controls get
focus.
For textboxes and comboboxes I have a function with the following
code: Function HiLiteControl()
Screen.ActiveControl.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl()

I would like to be able to do something similar for the label for a
checkbox and the labels for the options in an option group.

Thanks!

Steve




我会在每个控件的OnFocus上将控件名称传递给你的函数br />
事件。如果它是一个选项组或者其他东西只是传递标签的名称

而不是控件?


例如。 (类似这样......)


私人功能HiLiteControl(pMyControl作为控制)

pMyControl.BackColor =" 8454143"

结束功能


Private Sub txtMyTextBox_OnFocus()

HiLiteControl Me![txtMyTextBox]

End Sub


他们可能有十几种方法可以达到这个目的。


另外,当控件失去焦点时,如何重置颜色?
-

问候,


布拉德利


基督徒的回应
< a rel =nofollowhref =http://www.pastornet.net.au/responsetarget =_ blank> http://www.pastornet.net.au/response


PC数据表写道:
如何解决复选框的标签和选项
组中选项的标签?当复选框获得焦点时,Access会在标签周围绘制一个带点的
框。当选项组获得焦点时,Access会在第一个选项的标签或先前选择的选项
的标签周围绘制一个虚线框。我想将这些标签的背景颜色更改为
黄色,因为控件会聚焦。

对于文本框和组合框我有一个函数,代码如下:
函数HiLiteControl( )
Screen.ActiveControl.Backcolor =" 8454143"
结束功能

我把以下内容放在所有文本框的GotFocus事件和
组合框中:
= HiLiteControl()

我希望能够为标签创建类似的复选框
和选项组中选项的标签。
How can the label for a checkbox and the labels for the options in an option
group be addressed? When a checkbox gets the focus, Access draws a dotted
box around the label. When an option group gets the focus, Access draws a
dotted box around the label of the first option or the label of the option
previously selected. I would like to change the backcolor of these labels to
yellow as the controls get focus.

For textboxes and comboboxes I have a function with the following code:
Function HiLiteControl()
Screen.ActiveControl.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl()

I would like to be able to do something similar for the label for a checkbox
and the labels for the options in an option group.




使用复选框,您可以使用Screen.ActiveControl.Controls(0)。

附加的标签是组合框的孩子。 />

使用选项组它不是那么容易,因为活动控件是

框架选项按钮包含在内。


在LostFocus事件中使用Screen.ActiveControl来重置

后台是运行时错误等待t发生了。点击外面

当前表格是增加投掷错误几率的一种方法。


采取Br @ dley的建议。 Ditch Screen.ActiveControl并写一个函数

将控件作为参数。


我会挥动我的费用。




With checkboxes you can use Screen.ActiveControl.Controls(0).
The attached label is a ''child'' of the combobox.

With Option Groups it''s not so easy because the active control is the
Frame the option buttons are contained by.

Using Screen.ActiveControl in the LostFocus event to reset the
background is a runtime error waiting to happen. Clicking outside
the current form is one way to increase the odds of throwing an error.

Take Br@dley''s advice. Ditch Screen.ActiveControl and write a function
that takes a control as an argument.

I''ll wave my fee.



Bradley,


感谢您的回复!


我''我正在寻找一种像screen.ActiveLabel这样的方法,所以我可以在GotFocus事件代码行中为

提供相同的表达式(= HiLiteLabel())

复选框和选项组。


我在LostFocus事件中使用相同的过程来重置颜色,使用

backcolor为16777215.

Steve

" Br @ dley" <峰; br ***** @ usenet.com>在消息中写道

新闻:Kt ******************* @ news-server.bigpond.net.au ...
Bradley,

Thanks for responding!

I''m looking for a way to do something like screen.ActiveLabel so I can put
the same expression (=HiLiteLabel()) in the GotFocus event code line for all
the checkboxes and option groups.

I use the same process in the LostFocus event to reset the color using
backcolor of 16777215.

Steve
"Br@dley" <br*****@usenet.com> wrote in message
news:Kt*******************@news-server.bigpond.net.au...
PC数据表写道:
如何解决复选框的标签和
选项组中选项的标签?当复选框获得焦点时,Access
会在标签周围绘制一个虚线框。当选项组获得
焦点时,Access会在第一个选项
的标签或先前选择的选项的标签周围绘制一个虚线框。我想将这些标签的背景颜色改为黄色,因为控件会聚焦。
对于文本框和组合框我有一个函数,代码如下:功能HiLiteControl( )
Screen.ActiveControl.Backcolor =" 8454143"
结束功能

我把以下内容放在所有文本框的GotFocus事件和
组合框中:
= HiLiteControl()

我希望能够为
复选框的标签和选项组中的选项标签做类似的事情。

谢谢!

Steve
How can the label for a checkbox and the labels for the options in an
option group be addressed? When a checkbox gets the focus, Access
draws a dotted box around the label. When an option group gets the
focus, Access draws a dotted box around the label of the first option
or the label of the option previously selected. I would like to
change the backcolor of these labels to yellow as the controls get
focus.
For textboxes and comboboxes I have a function with the following
code: Function HiLiteControl()
Screen.ActiveControl.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl()

I would like to be able to do something similar for the label for a
checkbox and the labels for the options in an option group.

Thanks!

Steve



我会在每个控件的OnFocus
事件中将控件名称传递给您的函数。如果它是一个选项组或者其他东西只是传递标签的名称
而不是控件?

例如。 (像这样....)

私人功能HiLiteControl(pMyControl作为控制)
pMyControl.BackColor =" 8454143"
结束功能

> Private Sub txtMyTextBox_OnFocus()
HiLiteControl Me![txtMyTextBox]
End Sub

他们可能有十几种方法来实现这个目标。

此外,当控件失去焦点时,如何重置颜色?
-
问候,

布拉德利

基督徒的回应 http://www.pastornet.net.au/response



这篇关于复选框和选项组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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