如何让我的按钮看起来像是被点击的?

时间:2022-01-15 10:56:29

I have a textbox and some buttons on a form in my windows application. The user can enter his data either from buttons or from the textbox. I want the buttons to look like they are being clicked when the user enters the data from the text box.

我在windows应用程序中有一个文本框和一个窗体上的一些按钮。用户可以从按钮或文本框中输入他的数据。当用户从文本框中输入数据时,我希望按钮看起来像正在被单击。

I mean while the user is typing in the textbox the related buttons look like they are being clicked.

我的意思是,当用户输入文本框时,相关的按钮看起来像是被点击了。

I am using .Net and c#

我正在使用。net和c#。

Thank you.

谢谢你!

1 个解决方案

#1


1  

I believe I understand your question correctly:

我相信我正确地理解了你的问题:

You will need to create an event that triggers when someone types in the textbox(s), and then use btnName.Enabled = false in the event function.

您需要创建一个事件,当有人在文本框中输入时触发事件,然后使用btnName。在事件函数中启用= false。

#1


1  

I believe I understand your question correctly:

我相信我正确地理解了你的问题:

You will need to create an event that triggers when someone types in the textbox(s), and then use btnName.Enabled = false in the event function.

您需要创建一个事件,当有人在文本框中输入时触发事件,然后使用btnName。在事件函数中启用= false。