复选框在标签页中 [英] Checkbox in tabpages

查看:82
本文介绍了复选框在标签页中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



希望有人能帮助我。我把它工作得很好,直到我把它清理干净,放入一个tabcontrol。



我如何检查tabcontrol中的复选框是否在下面的代码中稍作修改?





非常感谢任何帮助。



我尝试了什么:



每个数字为整数数字





Dim CB As String =( CheckBox& number.ToString)

Dim FR As String =(fileReader& number.ToString)





如果CType(Me.Controls(CB),CheckBox).Checked Then





Dim FileLocation As String

FileLocation = Application.StartupPath& \ TXT Files \

FR = My.Computer.FileSystem.ReadAllText(FileLocation&\ checkbox& number.ToString&.txt)





RichTextBox1.AppendText(Environment.NewLine)



Clipboard.SetText(FR)





RichTextBox1.Select(RichTextBox1.Text.Length,0)



Me.RichTextBox1.Paste()



RichTextBox1.AppendText(Environment.NewLine)

RichTextBox1.AppendText(Environment.NewLine)< br $>
RichTextBox1.AppendText(Environment.NewLine)





结束如果

下一页

Hello,

Hoping anyone can help me. I had it working fine untill i cleaned it up by putting in a tabcontrol.

How can i check if a checkbox is checked in a tabcontrol with a slight modification in the code below?


Any help is very much appreciated.

What I have tried:

For Each number As Integer In numbers


Dim CB As String = ("CheckBox" & number.ToString)
Dim FR As String = ("fileReader" & number.ToString)


If CType(Me.Controls(CB), CheckBox).Checked Then


Dim FileLocation As String
FileLocation = Application.StartupPath & "\TXT Files\"
FR = My.Computer.FileSystem.ReadAllText(FileLocation & "\checkbox" & number.ToString & ".txt")


RichTextBox1.AppendText(Environment.NewLine)

Clipboard.SetText(FR)


RichTextBox1.Select(RichTextBox1.Text.Length, 0)

Me.RichTextBox1.Paste()

RichTextBox1.AppendText(Environment.NewLine)
RichTextBox1.AppendText(Environment.NewLine)
RichTextBox1.AppendText(Environment.NewLine)


End If
Next

推荐答案

您应该将每个requirered Checkbox的Checkbox.CheckedChanged-Eventhandler分配给方法。

这个方法的发送者会给你Checkbox导致事件的信息,你可以做一些必要的动作。

因为所有的CheckedChanged-Event复选框可以调用相同的方法。也许您尝试一下这些信息......
You should assign the Checkbox.CheckedChanged-Eventhandler from each requirered Checkbox to a method.
Here the sender of this method will give you the information which Checkbox has caused the Event and you can do the necessary action.
Of cause the CheckedChanged-Event from all the Checkboxes can call the same Method. Perhaps you try a little bit with this information ...


这篇关于复选框在标签页中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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