切换按钮的代码 [英] code for theToggle button

查看:60
本文介绍了切换按钮的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,
我需要切换按钮的代码才能在Windows窗体应用程序中打开和关闭.


I need a code for toggle button to switch on and off in windows form application.

Regards.

推荐答案

如果您的应用基于Windows,则可以使用复选框作为切换按钮.
为此,您必须将其Appearance属性更改为Button,并且可以将FlatStyle属性更改为Flat.
If your app is windows based you can use checkbox as toggle button.
For this you have to change its Appearance property to Button and you can change FlatStyle property to Flat.


使用Visual Studio中的工具箱将按钮添加到表单中.之后,您可以处理适当的事件以执行所需的操作.显然您想切换某些内容,但您没有告诉我们这是什么.
Add a button to your form using the toolbox in Visual Studio. After that, you can handle the appropriate event(s) to do what you want. Apparently you want to toggle something, but you didn''t tell us what that something is.


请参阅 ^ ].您所有此类问题都是无用的.

另请参见:更新按钮的C#代码 [ ^ ].

—SA
See code for save button[^]. All your questions of this sort are useless.

See also: C# code for the update button[^].

—SA


这篇关于切换按钮的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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