Results 1 to 5 of 5

Thread: can i make it read only and readable in the same time.

  1. #1

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    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

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    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...

  3. #3
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    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

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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
  •  



Click Here to Expand Forum to Full Width