如何将 Radiobox(GroupBox),Combobox 设为不可更改?
哪位大虾知道,在vb2005里面动态地(代码中) 将 Radiobox(GroupBox),Combobox 设为不可更改?
注意不能用 .enable= false,因为会灰掉使控件看不清楚。我找不到 Readonly 属性,还有canFocus好像也不能使用。 --------------------编程问答-------------------- 你可以在事件里让他的修改失效 --------------------编程问答-------------------- 一般有checked和afterchecked事件,在那里边设置为原来的状态,就可以不更改了 --------------------编程问答-------------------- 路过,顺便学习了 --------------------编程问答-------------------- 不能改还用ComboBox干什么,用个Label不就好了? --------------------编程问答-------------------- From窗体上一个ComboBox、一个CheckBox、一个RadioButton
--------------------编程问答-------------------- ComboBox1记得添加几个数据 --------------------编程问答-------------------- 把DropdownStyle 改为 Dropdownlist --------------------编程问答-------------------- 注意不能用 .enable= false,因为会灰掉使控件看不清楚
Public Class Form1
Dim C_Box, C_Check, R_Redio As Integer
Private Sub ComboBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.GotFocus
C_Box = ComboBox1.SelectedIndex
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
ComboBox1.SelectedIndex = C_Box
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ComboBox1.SelectedIndex = 0
End Sub
Private Sub CheckBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.GotFocus
C_Check = CheckBox1.Checked
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
CheckBox1.Checked = C_Check
End Sub
Private Sub RadioButton1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.GotFocus
R_Redio = RadioButton1.Checked
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
RadioButton1.Checked = R_Redio
End Sub
End Class
你不会更改一下控件的背景颜色哦? --------------------编程问答-------------------- 学习了!!! --------------------编程问答-------------------- 都有说。。。。。。。。。
补充:.NET技术 , VB.NET