关于使用参数传递给复选框的的CheckedChanged事件 [英] About using arguments passed to the CheckedChanged event of Checkbox

查看:353
本文介绍了关于使用参数传递给复选框的的CheckedChanged事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何显示文字复选框的属性值被点击时?

How do I display the value of the "Text" property of a checkbox when it is clicked?

于是用的CheckedChanged事件,类型发送方放两个参数; EventArgs的传递。

So with the CheckedChanged event, two arguments of type sender & eventArgs are passed.

如何使用这些参数做我一样的吗?

How do I the same using these arguments?

推荐答案

是的,但你也可能要取消它,如果它未选中?

Yes, but do you possibly also want to unset it if it's unchecked?

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
    If CType(sender, CheckBox).Checked Then
        Label1.Text = CType(sender, CheckBox).Text
    Else
        Label1.Text = ""
    End If
End Sub

这篇关于关于使用参数传递给复选框的的CheckedChanged事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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