• Advertisement
Sign in to follow this  

C#: How to make form elements user un-selectable?

This topic is 3918 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

C# gurus, I want to create a GUI form to display information and don't want any user inputs. 1. Is there a way to make radio-buttons user un-selectable? I want my program to control which radio-button to select and display it to the user. I don't want to disable or make the buttons invisible. 2. Is there a way to make the rows/cells/columns in a DataGridView table user un-selectable? I already set up the table to be read-only and MultiSelect=false, but that still doesn't do the trick.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by faculaganymede
I want to create a GUI form to display information and don't want any user inputs.

Usually, when you want a standard control to act in a non-standard way the easiest solution is build a custom control inheriting it or including it inside and controlling it's behaviour.

For example:
- create a custom control,
- put a radiobutton inside,
- capture any click in your control,
- manage the selections yourself.

There are other solutions but when I start needing custom behaviors I usually save time by taking complete control and managing the behavior myself.

Share this post


Link to post
Share on other sites
Thanks.

I found the following alternative solutions:

1. Set the AutoCheck property to false

2. Call DataGridView ClearSelection function inside SelectionChanged

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement