如何在输入数字时突出显示按钮? [英] how to highlight button while entering number?

查看:82
本文介绍了如何在输入数字时突出显示按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private Sub one_Click(ByVal sender As Object, ByVal e As EventArgs) Handles one.Click
       empBox.Text += 1
       If empBox.Text = 1 Then
           one.BackColor = Color.Red
       End If

   End Sub

推荐答案

我不知道它在Basic中是怎么样的,但至少在C#中,文本框提供了输入和'离开'事件。考虑将Enter-event中的BackColor设置为Red,并将Leave-event中的BackColor设置回原始颜色。
I don't exactly know how it is like in Basic, but at least in C# the textboxes provide an 'Enter' and a 'Leave' event. Consider setting the BackColor in the Enter-event to Red, and setting it in the Leave-event back to its original color.


这篇关于如何在输入数字时突出显示按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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