重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
参考方法如下:
站在用户的角度思考问题,与客户深入沟通,找到张家川回族自治网站设计与张家川回族自治网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:成都做网站、成都网站设计、企业官网、英文网站、手机端网站、网站推广、域名注册、网站空间、企业邮箱。业务覆盖张家川回族自治地区。
$("input[type='checkbox']").attr("checked",true);
用js这样就行了,如果用C#,参考如下:
foreach (Control item in this.Controls)
{
if (item is CheckBox)
{
CheckBox box = (CheckBox)item;
box.Checked = true;
}
}
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
MessageBox.Show(ListBox1.SelectedItem.ToString)
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Integer = 0 To 10
ListBox1.Items.Add(i.ToString)
Next
End Sub
'''''''选择多项
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Integer = 0 To 10
ListBox1.Items.Add(i.ToString)
Next
ListBox1.SelectionMode = SelectionMode.MultiSimple
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim item
For Each item In ListBox1.SelectedItems
MessageBox.Show(item.ToString)
Next
End Sub
Private Sub TextBox1_Click(sender As Object, e As EventArgs) Handles TextBox1.Click
TextBox1.SelectAll()
TextBox1.ForeColor = Color.Blue
End Sub
如果不想每次都这样的话,就加一个if判断TextBox1.ForeColor 是否是Color.Blue就可以了
SelectAll其实已经把所有文本选上了,只不过没有高亮而已,但是你可以自己模拟一个选择高亮:
r.SelectAll()
r.SelectionColor = System.Drawing.Color.White ' 文字色
r.SelectionBackColor = System.Drawing.Color.Navy ' 背景色