I'm not sure if I'm doing something wrong or not, but every time I change something in my user control, all my controls get changed from Public to Protected. I have a user control which has menu buttons on it. If I add a button, all my other button's declarations switch from Public to Protected. I also have to double click each control to link the source code back to the button again. Here are my declarations that change:
Public MustInherit Class menu
Inherits System.Web.UI.UserControl
Public WithEvents btnInspector As System.Web.UI.WebControls.Button
Public WithEvents btnPosting As System.Web.UI.WebControls.Button
Public WithEvents btnReport As System.Web.UI.WebControls.Button
Public WithEvents btnInsurance As System.Web.UI.WebControls.Button
Public WithEvents btnTransaction As System.Web.UI.WebControls.Button
Public WithEvents btnUtility As System.Web.UI.WebControls.Button
Public WithEvents btnViolation As System.Web.UI.WebControls.Button
Public WithEvents btnOptions As System.Web.UI.WebControls.Button
Public WithEvents btnOwners As System.Web.UI.WebControls.Button
Public WithEvents btnBoiler As System.Web.UI.WebControls.Button
Now if I change anything in the control, such as add a new button, my code is automatically changed to this:
Public MustInherit Class menu
Inherits System.Web.UI.UserControl
Protected WithEvents btnInspector As System.Web.UI.WebControls.Button
Protected WithEvents btnPosting As System.Web.UI.WebControls.Button
Protected WithEvents btnReport As System.Web.UI.WebControls.Button
Protected WithEvents btnInsurance As System.Web.UI.WebControls.Button
Protected WithEvents btnTransaction As System.Web.UI.WebControls.Button
Protected WithEvents btnUtility As System.Web.UI.WebControls.Button
Protected WithEvents btnViolation As System.Web.UI.WebControls.Button
Protected WithEvents btnOptions As System.Web.UI.WebControls.Button
Protected WithEvents btnOwners As System.Web.UI.WebControls.Button
Protected WithEvents btnBoiler As System.Web.UI.WebControls.Button
If I don't set the buttons as public, I get an error stating that the button's events can't be raised because the button is Private. It runs fine once I relink the source code to the buttons and switch all the controls back to Public. It's just a real pain to have to do that every time I make a change.
Public MustInherit Class menu
Inherits System.Web.UI.UserControl
Public WithEvents btnInspector As System.Web.UI.WebControls.Button
Public WithEvents btnPosting As System.Web.UI.WebControls.Button
Public WithEvents btnReport As System.Web.UI.WebControls.Button
Public WithEvents btnInsurance As System.Web.UI.WebControls.Button
Public WithEvents btnTransaction As System.Web.UI.WebControls.Button
Public WithEvents btnUtility As System.Web.UI.WebControls.Button
Public WithEvents btnViolation As System.Web.UI.WebControls.Button
Public WithEvents btnOptions As System.Web.UI.WebControls.Button
Public WithEvents btnOwners As System.Web.UI.WebControls.Button
Public WithEvents btnBoiler As System.Web.UI.WebControls.Button
Now if I change anything in the control, such as add a new button, my code is automatically changed to this:
Public MustInherit Class menu
Inherits System.Web.UI.UserControl
Protected WithEvents btnInspector As System.Web.UI.WebControls.Button
Protected WithEvents btnPosting As System.Web.UI.WebControls.Button
Protected WithEvents btnReport As System.Web.UI.WebControls.Button
Protected WithEvents btnInsurance As System.Web.UI.WebControls.Button
Protected WithEvents btnTransaction As System.Web.UI.WebControls.Button
Protected WithEvents btnUtility As System.Web.UI.WebControls.Button
Protected WithEvents btnViolation As System.Web.UI.WebControls.Button
Protected WithEvents btnOptions As System.Web.UI.WebControls.Button
Protected WithEvents btnOwners As System.Web.UI.WebControls.Button
Protected WithEvents btnBoiler As System.Web.UI.WebControls.Button
If I don't set the buttons as public, I get an error stating that the button's events can't be raised because the button is Private. It runs fine once I relink the source code to the buttons and switch all the controls back to Public. It's just a real pain to have to do that every time I make a change.