can i make it read only and readable in the same time.
Hi all,
i want to know if there is a way to make a radio button or a checkbox readonly and not disabled. my problem is: some users do have view permession and not editing permession. in this case they are allowed to see the form information but not change it. in textboxes there is a read only problem that i use. but in radio buttons the only way is to disable them (set enabled = false) in this case the text is not easily read at all.
is there another solution that can be clear for users to read.
thx in advance
rgds
Re: can i make it read only and readable in the same time.
Try setting the AutoCheck property of the checkbox to False. I think this prevents the user from changing the value, but still allows your program to change the checked state in code...
Re: can i make it read only and readable in the same time.
Or, whatever flag you use for the permissions, do a check on it in the change event of the radio button or checkbox - if the user does not have appropriate permissions then reset the options / checks...
Is there a locked property? I can't remember and I don't have .Net on this machine...
zaza
Re: can i make it read only and readable in the same time.
If you want a disabled CheckBox/RadioButton without greyed text then use a Label for the text. If you set your tab order correctly, i.e. the Label before the CheckBox/RadioButton, you can still use mnemonics as you normally would. You could even create a UserControl containing the two controls if it's something you want to use in more than one place.
Re: can i make it read only and readable in the same time.
Yes, the AutoCheck property when set to True will automatically change the radiobutton selection. When set to False it will not change the selection and you will have to manually code it to change. This is what you want. Then just determine which users can change it and which can not. Select case on them, etc.