Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox ReadOnly?
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00870633
Message ID:
00872553
Views:
11
Hi Terry,

If that is the case in your situation, then I would recommend what Bonnie suggested. My suggestions works when you ust want to override the click event to eliminate the user from changing the value.

>Cathi,
>
>Thank you for the suggestion. It worked but the bound data changed thus triggering my default "Edit Mode" in my winform baseclass.
>
>Is there a way to totally prevent the user from changing the value?
>
>Regards,
>
>Terry Carroll
>
>
>
>
>>Hi Terry,
>>
>>One approach is to handle the click event of the checkbox. In the click event, determine if you want the user to be able to change the state.
>>
>>
>>Private Sub CheckBox_Click(ByVal sender As Object, ByVal e As System.EventArgs)
>>   'Determine if the user can update the control
>>   ' ...
>>   Dim Obj As CheckBox = CType(sender, CheckBox)
>>   Obj.Checked = Not Obj.Checked
>>End Sub
>>
>>
>>>In a winform, how can a checkbox be set to readonly without being disabled?
>>>
>>>Thanks in Advance,
>>>
>>>Terry Carroll
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform