Windows控制启用和禁用 [英] windows controls enabling and disabling

查看:84
本文介绍了Windows控制启用和禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有8个控件(文本框和组合),我必须使用此表格进行多次报告。基于特定报告我必须启用或禁用控件。如何动态执行此操作..



任何人都可以帮助我..



在此先感谢..

Hi all,

I have a from consisting of 8 controls(textbox and combo) and i had to use this form for several reports.Based on particular report i have to enable or disable the controls.How can i do this dynamically..

Any one help me out..

Thanks in advance..

推荐答案

你可以这样做.........



在报告中使用基于文本值的条件

You could do it as.........

Using text value based conditions in your report
Textbox1.enabled = (Condition_In_Report = "Text_Value")





在报告中使用基于数字的值



Using Numeric based values in your report

Combo1.Enabled = (Condition_In_Report = 6 or 9 or (12 and 3))





只需替换决定启用或禁用控件的数值或文本值。





Just replace the numeric or text values that decide wether the control should be enabled or disabled.

Textbox2.Enabled = (Budget < Maximumvalue or Today = "Monday")  





你总是混合搭配



You always mix and match too


select case lstrreportname

caseSales Summary

text1.enable = false

label1.enable = false

text2.enable = true

lable2.enable = true

csae收集报告

text1。 enable = true

label1.enable = true

text2.enable = false

lable2.enable = false



...

结束选择
select case lstrreportname
case "Sales Summary"
text1.enable = false
label1.enable = false
text2.enable = true
lable2.enable = true
csae "Collection Report"
text1.enable = true
label1.enable = true
text2.enable = false
lable2.enable = false

...
end select


这篇关于Windows控制启用和禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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