Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

[HelpMe]Design loading, Coding not working[Urgent]

Hi there, I've got a problem.. I don't really know when it occurs but it also appears when I delete a button but I let the code stay and re-add the button. If you'll double click on the button it says; button1_1 for example (something like that) its not a big deal to copy that code into the method. But now I've made a project in C# Express and reinstalled my computer, then installed Visual Studio and opened the project but now I only got the theme/design but when I click a button nothing happens and if I double click (go to the method) it says name_1 but this time its a quite a big deal to copy and paste all the code since it has many methods. Any way to fix this problem?
Sorry for english I hope its clear 😵
Thanks in Advance
When you double click a button C# adds event listeners to the code automatically. I think it's in the Form.cs code but i'm not 100% on that. you need to remove or rename the listeners; or change the names of your buttons and double click again. Hope this helps

If you're opening a project you saved, it should all still be set up... but again i'm not 100%. You might end up doing some copying and pasting :(
(Dec 7, 2011 11:12 PM)DArkTussin Wrote:  When you double click a button C# adds event listeners to the code automatically. I think it's in the Form.cs code but i'm not 100% on that. you need to remove or rename the listeners; or change the names of your buttons and double click again. Hope this helps

If you're opening a project you saved, it should all still be set up... but again i'm not 100%. You might end up doing some copying and pasting :(

I couldn't fix it so I just had to copy paste but I hope there will be a fix because it happens alot to me.. :(
Within Visual Studio :

- Display your form in the designer
- Click one time on your button to make it the active item in the designer
- Make sure the Properties window is active (accessible from the View menu)
- In property window select the Events icon (a kind of thunder sign) a list of events is displayed and for some of them there may be a method name associated with the event.
- Assuming you want to handle the Click event go to that line in the event list and click in the right part of the line.
- A dropdown list will appear with a list of already existing methods suitable for handling the event.
- Select the already existing one.

That's it.

Warning : This is the procedure I sue on a VS Pro edition. Some details may change in the Express Edition.
You can also find the addEventListener methods and point them to your other method by changing the name, if you want, in the future.
(Dec 8, 2011 09:06 AM)E25EB8582FF05BF Wrote:  Within Visual Studio :

- Display your form in the designer
- Click one time on your button to make it the active item in the designer
- Make sure the Properties window is active (accessible from the View menu)
- In property window select the Events icon (a kind of thunder sign) a list of events is displayed and for some of them there may be a method name associated with the event.
- Assuming you want to handle the Click event go to that line in the event list and click in the right part of the line.
- A dropdown list will appear with a list of already existing methods suitable for handling the event.
- Select the already existing one.

That's it.

Warning : This is the procedure I sue on a VS Pro edition. Some details may change in the Express Edition.

Thank you I think that will work :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by bohhSep 30, 2020 12:53 PM 3 283 Sep 30, 2020 12:53 PM
Last Post: G.P.D.
[Python] by Coffee is loveFeb 17, 2015 11:29 AM 2 121 Feb 17, 2015 11:29 AM
Last Post: TheComet
[Java] by blenblen2g2123Dec 1, 2014 01:33 PM 9 176 Dec 1, 2014 01:33 PM
Last Post: borisganji1