当我输入鼠标时更改文本框的边框 [英] to change bordor of text box when i enter my mouse

查看:76
本文介绍了当我输入鼠标时更改文本框的边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在文本框内输入鼠标时如何更改文本框的bordor颜色,语言为c#
请尽快为我提供帮助,

how to change textbox bordor color when i enter my mouse inside the textbox, language is c#
please help me as soon as possible ,

推荐答案

您需要使用文本框的MouseEnterMouseLeave事件在文本框中进行更改.据我记得,当鼠标进入文本框时,您想在MouseEnter事件中更改边框颜色,并在MouseLeave事件中将其设置回其先前的状态.

但是textbox类没有边框颜色属性,因此您必须创建自己的自定义控件并从那里(而不是从textbox类中)调整文本框.

一些示例链接:
如何在C#中更改Textbox BorderColor? [ ^ ]
如何在C#中更改TextBox边框颜色? [ ^ ]

祝你好运,
OI
You need to use MouseEnter and MouseLeave events of the textbox to make changes in your textbox. As far as I remember when mouse enters to your textbox you want to change the border color in MouseEnter event and set it back to its previous state in MouseLeave event.

But textbox class does not have a border color property so you have to create your own custom control and tweak your textbox from there, not from textbox class.

Some example links:
How to change Textbox BorderColor in C#?[^]
How to change TextBox border color in C# ?[^]

Good luck,
OI


这篇关于当我输入鼠标时更改文本框的边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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