Getting .NET Button ListBar control to work

In: Programming

9 Mar 2004

Dave (DarkAngel) has responded to my call for help regarding the .NET Button ListBar Control and has kindly allowed me to post the solution here. Dave is the man really – he went through the trouble of grabbing the control, loading up VS.NET and working through it step by step with me in his email. All that for a stranger. I love you Dave!

The problem I had was trying to import the .NET Button ListBar Control into my VS.NET Toolbox. The instructions said to import the ButtonListBar.vb file into the project and it should work, but it doesn’t in Visual Studio.NET 2003. I think that is the reason it didn’t work (that it is VS.NET 2003 instead of just VS.NET).

Opening the ButtonListBar.vb file in the Designer threw out an error (see the call for help entry). Dave fixed that with this solution (also via email):

… move the region event argument classes to the end of the ButtonListBar.

He went on to help me compile the source files into a DLL, which I’m familiar with using for importing controls. Below are his instructions (slightly paraphrased). The credit goes solely to Dave (DarkAngel) – I’m merely reproducing it for the benefit of anyone who next comes across this problem.

  1. Open up Visual Studio .NET (Visual Studio .NET 2003 to be exact)
  2. Create a new project by clicking File -> New Project (I’m using Visual Basic, so I chose Visual Basic Project).
  3. Choose “Windows Control Library”.
  4. What we’ve done so far is just create a control library project which is ideal for putting new controls in. This will build to a DLL.
  5. Remove UserControl1.vb (the default file VS.NET creates) from the Solution Explorer (it’s unnecessary).
  6. Right click the project in the solution explorer and select Add -> Add existing item
  7. Add the ButtonListBar.vb file in the control source files downloaded.
  8. Build the project (choose to build for “Release”).
  9. The compiled DLL will then be in the bin/ directory of the project folder. You now have the ButtonListBar control in DLL form. All the remains is to add this control into the Toolbar of the project in which you want to use it.

Using the control:

  1. In the project you want to add the toolbar to, right-click your Toolbox and select “Add/Remove items”.
  2. Click “Browse” under the .net framework components tab.
  3. Browse to the location of the DLL we just created and double click it.
  4. Click OK to dismiss the Add/Remove items dialog.
  5. The ButtonListBar control should now be the bottom entry on your list. (You can right-click and sort alphabetically if you like).

2 Responses to Getting .NET Button ListBar control to work

Avatar

Rob

March 10th, 2004 at 12am

Dave is the man really

Yeah, Dave is the man, except when he is your boss! ;-)

Avatar

Robert Johnson's Online HooHa!

March 11th, 2004 at 12pm

I am going to lose my job over this one.
Friendster.com. Ever heard of it? It is an “online community”. Kinda like an online dating service, but without the dating. Or at least it could be. You would sign-up then invite your friends, add them as friends, and before you…