Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controls on Form Not Shown in Designer

I am working on a WinForms project, and I have a form where I have a DataGrid, a TextBox, and 2 button controls (btnNew and btnSearch). The click event of a btnSearch is supposed to perform a search on the DataGrid.

I deleted the event handler for the search button and have saved my work. It now appears that all other controls have been deleted and the form is back to the default state. The application works fine though when run, with some errors. I have resolved the error but the designer view is still in the default state. How do I go about reinstating my form's design view?

like image 433
seun Avatar asked Oct 25 '25 23:10

seun


2 Answers

i had your problem and solved it in this way:

just make another form with another name(NewForm.cs) and copy the InitializeComponent() content from YourFirstForm.designer.cs and paste it into NewForm.designer.cs InitializeComponent() function. but be careful when copy and paste the function content change all YourFirstForm keywords to NewForm . finally Remove YourFirstForm and just work with your NewForm....

like image 64
ako Avatar answered Oct 28 '25 15:10

ako


With the control selected in the properties window.

  1. Right click on an empty space on the form,
  2. Click cut
  3. Right click / then paste into a cell somewhere in a form control.
like image 38
formUser1 Avatar answered Oct 28 '25 15:10

formUser1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!