Dear Sir/Mam
I have a datagridview in my window project. There is one button on which i am going to open a form with certain record. I want to make that form as a read only. So that he can only view the form.He can't not edit anything on that form. So how can i do this? Please help me.
Thanks
with Regards
Sanjay Kumar Gupta
AnkurPosted Sep 9, 2010, 2:51 AM
i think following might help:
execute a loop for each control in the form and set read only property to true here i am providing example of textbox only, you can add as many "if else" conditions as you like depending on the condition:
foreach (Control ctrl in this.Controls)
{
if (ctrl is TextBox)
{
((TextBox)ctrl).ReadOnly = true;
}
}
thanks and regards
ankur malik
Sam HobbsPosted Sep 9, 2010, 2:31 AM