|
-
Dec 31st, 2005, 05:06 AM
#1
Thread Starter
Frenzied Member
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
-
Dec 31st, 2005, 06:00 AM
#2
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...
-
Dec 31st, 2005, 06:14 AM
#3
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
-
Jan 1st, 2006, 12:06 PM
#4
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.
-
Jan 1st, 2006, 02:58 PM
#5
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|