I am working on a soundboard app. Everything was perfect, until I did a complete makeover of the UI and now half of the buttons don't work at all.
I had included about 40 sounds or so with their corresponding buttons, plus one more that displayed a message box notified the user that there are no sounds currently in the selected category. The app was working perfectly. However, due to its horrible UI, I had to do a complete makeover. I got rid of group boxes and put everything inside tabs. After the makeover, I imported some more sounds. I added them in their categories and I was done. All that was needed was to write the code for the new buttons. However, after compiling everything, the app seemed OK, but there was a huge issue. The buttons that were there before the makeover don't work at all, as if the buttonx_Click
method is empty. Not even the buttons that display the message boxes work. But, the new ones work perfectly.
Here is the code used for getting the sound file from Resources and playing it back:
System.IO.Stream str = Properties.Resources.my_sound;
System.Media.SoundPlayer snd = new System.Media.SoundPlayer(str);
snd.Play();
I expected the buttons to remain functional since I did not make any changes to the existing code. However, 2 mishaps happened during the makeover:
I accidentally pressed Ctrl + A and then I double clicked in a blank area, but there was a Panel element and that added the methods for the new buttons and for the existing ones. (there were buttonx_Click_1
methods) I was able to revert this easily by using Ctrl + Z.
The second mishap happened in the Resources file, probably the most critical one. In order to not look for the new sounds, select them and change their option to "Embedded in .resx", I just selected them all and embedded them. I thought that the 2nd mishap caused this, but it does not explain the non-functioning message box buttons.
Can anyone help me?