drag and drop to a form lacks functionality
1. There is no error catching code in the bindingNavigator toolstrip buttons.2. There is no canceledit button. It's a pain having to add one each time.
3. I would like to make my own control that includes not only the canceledit button but all the code I want. I have no experience whatsoever in inherited controls or user controls. So,
a. Is it possible to include code in a user control? Can I create my own toolstrip with the code I want on the click event on each button, that also refers to subroutines that catches errors? As in DataWalkthrough, Smart Client Data in Visual Basic 2005?
It'd be a big pain to put in the code each time.
This question involves data access, inheritance, and user controls. It may not be the best forum for the question. If not, can somebody suggest a better forum?
I tried a bunch of searches, but the forum hasn't accumulated enough questions and answers for my search to produce any useful results.
dennist
[983 byte] By [
dennist] at [2008-2-7]
dennist wrote: |
| 1. There is no error catching code in the bindingNavigator toolstrip buttons. 2. There is no canceledit button. It's a pain having to add one each time. 3. I would like to make my own control that includes not only the canceledit button but all the code I want. I have no experience whatsoever in inherited controls or user controls. So, a. Is it possible to include code in a user control? Can I create my own toolstrip with the code I want on the click event on each button, that also refers to subroutines that catches errors? As in DataWalkthrough, Smart Client Data in Visual Basic 2005? It'd be a big pain to put in the code each time. This question involves data access, inheritance, and user controls. It may not be the best forum for the question. If not, can somebody suggest a better forum? I tried a bunch of searches, but the forum hasn't accumulated enough questions and answers for my search to produce any useful results. dennist
|
|
dennist,
The UserControl is like any other control. You can inherit from it, and do anything you wish. You can add your button, as well as all of the error handling and data access code that you want.
Also, once you do that, it should be added to the toolbox. You can also go to the options screen and indicate you want the control to be used in the Data Source window as well as a control to bind to.
Hope this helps.
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com