Help needed with .NET and Java

In: Java

8 Mar 2004

Update: Dave has an excellent solution to the ButtonListBar .NET control problem.

Firstly, the .NET question: does anybody know how to get this Button ListBar Control to work?

I was trying to get the.NET Button ListBar control into my VB project’s toolbox – I followed these instructions:

To use the control, add either the ButtonListBar.vb or ButtonListBar.cs file to your project. You should find the control automatically appears in the Toolbox; if not you’ll need to force the toolbox to display the
control: typically I find that double clicking on the control source file to open its designer causes this to occur.”

Unfortunately, it doesn’t appear automatically when I added ButtonListBar.vb (via “Add existing item”). So I double-clicked the source file… But it threw out this error

The class ButtonListBar can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file…

Which I don’t understand of course. Neither did it cause the ListBar control to appear in the Toolbox. I have emailed the author about this, but if anyone knows what I’m doing wrong, please let me know ASAP.

This of course leads to the question: What is the correct way to add a user control which comes in source form?

Now, for the Java question: is there an existing library/package that would allow me to calculate the median and, say, the 95th percentile of a population quickly? I searched to no avail, of course, before I ask this.

I can do this myself the hard way, but I’m really pressed for time. I’d like to reuse an existing solution if there is any.

Thanks for any leads!

5 Responses to Help needed with .NET and Java

Avatar

Stephan Segraves

March 8th, 2004 at 11pm

For your .NET problem are you using the “Add File to Project”? If so when you add the file it should add the Namespace of the file at the top of your code.

What version of .NET?

Avatar

Cheah Chu Yeow

March 8th, 2004 at 11pm

I’m using Visual Studio .NET 2003.

With the help of Dave via email, I managed to get rid of the error when trying to view the file in the Designer view. That was done by moving the region containing the “event argument classes to the end of the ButtonListBar.vb”.

I can add the file now, which I did using “Add Existing Item”, Stephan. It didn’t add its namespace anywhere. I couldn’t find a “Add File to Project” link.

Anyway, the control appears in the Toolbox, but it complains when I try to use it. It complains that it needs a control that has been built.

Now I need help compiling the control into a DLL :)

Avatar

Dave

March 9th, 2004 at 3am

I e-mailed a solution to the dll problem as well, hopefully it works, it worked here.

Avatar

Cheah Chu Yeow

March 9th, 2004 at 3pm

Yup Dave’s solution works. Thanks man!

I’ve posted his solution in a new entry.

Avatar

ilod

July 28th, 2006 at 7pm

Very good website you have here.