Effecting other controls on a form from within a compiled control
This is something I really want to learn more about.
Say I made a control and it does many nice things that are useful. One thing is to press the "Disable" button and disable (enable = False) every other control on a form. Now preferably I just want to drag this control onto a form and be able to click the button and everything is disabled.
I'm pretty sure I can do this easily. Just do a myBase.ControlCollection "for each control..." and make sure I'm not disabling the control doing this. This would work right?
Well where I want to take it is to be able to choose certain controls to subscribe to this controlcollection rather than just disable everything.
Primarily this is a control to help manage database front end functionality. When I do an "Edit", I want to disable all the navigation controls, but enable all of the databound controls.
part of the problem (why I'm not just doing a search for databound controls) is that other databound controls are the opposite (like some listboxes & comboboxes) and are used for navigation and should be disabled for Edit/add.
The optimal solution is a way to just drop the control and go. I don't think that'll happen. I think the best I'll get is exposing properties to add controls to specific collections and have (at least) two controlcollection: 1 to disable on Add/Edit and enable on View and another to enable on Add/Edit and disable on View.
If anyone has similar ideas that would work, I'm definately all ears. I would have just tested this all out, but I'm not able to get to VS for a while. I'll post when I do get some testing done.
This is something I really want to learn more about.
Say I made a control and it does many nice things that are useful. One thing is to press the "Disable" button and disable (enable = False) every other control on a form. Now preferably I just want to drag this control onto a form and be able to click the button and everything is disabled.
I'm pretty sure I can do this easily. Just do a myBase.ControlCollection "for each control..." and make sure I'm not disabling the control doing this. This would work right?
Well where I want to take it is to be able to choose certain controls to subscribe to this controlcollection rather than just disable everything.
Primarily this is a control to help manage database front end functionality. When I do an "Edit", I want to disable all the navigation controls, but enable all of the databound controls.
part of the problem (why I'm not just doing a search for databound controls) is that other databound controls are the opposite (like some listboxes & comboboxes) and are used for navigation and should be disabled for Edit/add.
The optimal solution is a way to just drop the control and go. I don't think that'll happen. I think the best I'll get is exposing properties to add controls to specific collections and have (at least) two controlcollection: 1 to disable on Add/Edit and enable on View and another to enable on Add/Edit and disable on View.
If anyone has similar ideas that would work, I'm definately all ears. I would have just tested this all out, but I'm not able to get to VS for a while. I'll post when I do get some testing done.
Last edited: