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

Started by
2 comments, last by faculaganymede 16 years, 10 months ago
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.
Advertisement
Um... why can't you disable 'em?
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.
Thanks.

I found the following alternative solutions:

1. Set the AutoCheck property to false

2. Call DataGridView ClearSelection function inside SelectionChanged

This topic is closed to new replies.

Advertisement