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]
# 1
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

casperOne at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

Nicholas,

Thank you very much. Problem is that I've never used inheritance or created a control. Is there a sample, article or walkthrough that you know of? I couldn't find anything in the vs studio 2005 msdn documentation.

dennist685

dennist at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
dennist wrote:

Nicholas,

Thank you very much. Problem is that I've never used inheritance or created a control. Is there a sample, article or walkthrough that you know of? I couldn't find anything in the vs studio 2005 msdn documentation.

dennist685


dennist,

Check out the section of the .NET Framework documentation titled "Control Authoring for Windows Forms", located at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconControlCreation.asp

- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

casperOne at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
nicolas,

exactly what I need. I forgot I could use the msdn library for 2003.

dennist

dennist at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...