我想通过改变它的背景来强调主动控制 [英] I want to highlight active control by changing its backcolor

查看:59
本文介绍了我想通过改变它的背景来强调主动控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是VB6.0开发人员,现在跳进了vb.net 10

我想通过改变它的背景来强调主动控制

我在vb6中做到了这一点。 0使用计时器,但定期在屏幕上显示混蛋。

i想在VB.Net中不使用计时器。我怎么做。

请帮忙。

I am VB6.0 developer and now jumped into vb.net 10
I want to highlight active control by changing its backcolor
I have done this in vb6.0 using timer but that shows jerk in screen periodically.
i want to do it in VB.Net without using timer. How i can do it.
Please help.

推荐答案

你好,

对于初学者你可以创建控件有你需要的行为,这是一个小例子:



Howdy,
For starters you can create controls that have the behaviors you need, here is a small example:

Public Class myTextBox
    Inherits TextBox

    Private Sub myTextBox_GotFocus(sender As Object, e As EventArgs) Handles Me.GotFocus
        BackColor = Color.White
        ForeColor = Color.Black
    End Sub
    Private Sub myTextBox_LostFocus(sender As Object, e As EventArgs) Handles Me.LostFocus
        BackColor = Color.FromArgb(255, 240, 240, 240)
        ForeColor = Color.FromArgb(255, 165, 165, 165)
    End Sub
End Class





此外,重建解决方案后,此控件将显示在工具箱区域的顶部。然后,您可以选择,拖放到您的表单上。虽然这远不是​​一个完整的例子,但很容易制作一个适用于Windows环境事件和操作的解决方案。



regs



ron O。



Also, after you have rebuilt the solution this control will show up at the top of the Toolbox area. You can then select, drag and drop this on to your form. Although this is far from a complete example, it is easy enough to make a solution that works well with the events and actions of the Windows environment.

regs

ron O.


这篇关于我想通过改变它的背景来强调主动控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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