2
Answers

How do I add a control from another folder outside of vb?

joepkey

joepkey

20y
1.6k
1
I have a scroller control that is in a folder at another part of the hard drive & I need to intergrate it into vb. I tried the add user control but it has no option to browse other areas for files. I also tried add existing item & it let me add the control file but I couldn't put it in the toolbox where I needed it. It put it in the solution explorer. I don't know if you can get it from the sol explorer to the toolbox or not. If someone knows how to do this, let me know........ Thanks, Joe
Answers (2)
0
Vulpes
NA 98.3k 1.5m 12y
Try this:

import java.io.*;
import java.util.*;

public class Catalin
{
   public static void main(String[] args)
   {
       ArrayList<Integer> sumsList = new ArrayList<Integer>();

       try
       {
          BufferedReader br = new BufferedReader(new FileReader("catalin.txt"));
          String line;

          while ((line = br.readLine()) != null) 
          {
             String[] items = line.split(";");
             int number = Integer.parseInt(items[1]);
             int number2 = Integer.parseInt(items[2]);
             sumsList.add(number + number2);
          }

          br.close();
       }
       catch(IOException e)
       {
          System.out.println("I/O Error : " + e);
       }
       
       // convert ArrayList<Integer> to int[]
       int[] sumsArray = new int[sumsList.size()];
       for(int i = 0; i < sumsArray.length; i++) sumsArray[i] = sumsList.get(i);

       System.out.println("Line Sum");
       System.out.println("---- ---");

       for(int i = 0; i < sumsArray.length; i++)
       { 
          System.out.println((i + 1) + "     " + sumsArray[i]);
       }
   }
}