hi there,

i have a interface which has text boxes, combo boxes and datagrid view, i load the data to these from the database. how can i make these un-editable. do i have to do it item by item?

can't i make the whole interface un-editable unless one button in the interface.


if you want an easy way to disable all of the controls you can group them together inside a panel. Set the panel's Enabled property to false and all of the controls inside it will be disabled too.
If you leave the button outside the panel it will be uneffected.
You can still edit the controls in code (ie set textbox text property), only difference between disabled and readonly is the font is gray when disabled.
If you prefer to set them to readonly, you can iterate through the panel's Controls collection and set them to read only that way.

EDIT: i should say that ESSENTIALLY the only differance is the font colour. There are other differances