Click here to Skip to main content
15,920,005 members
Home / Discussions / C#
   

C#

 
QuestionExcel C# question Pin
antsims15-Oct-09 9:45
antsims15-Oct-09 9:45 
AnswerRe: Excel C# question Pin
Luc Pattyn15-Oct-09 10:00
sitebuilderLuc Pattyn15-Oct-09 10:00 
QuestionSetting focus messes up scroll position Pin
Alan Balkany15-Oct-09 8:50
Alan Balkany15-Oct-09 8:50 
AnswerRe: Setting focus messes up scroll position Pin
Saksida Bojan15-Oct-09 9:58
Saksida Bojan15-Oct-09 9:58 
AnswerRe: Setting focus messes up scroll position Pin
diffy674-May-10 6:20
diffy674-May-10 6:20 
QuestionSend CTRL-S And CTRL-X To Open Excel Doc Pin
Kevin Marois15-Oct-09 8:03
professionalKevin Marois15-Oct-09 8:03 
AnswerRe: Send CTRL-S And CTRL-X To Open Excel Doc Pin
Luc Pattyn15-Oct-09 8:18
sitebuilderLuc Pattyn15-Oct-09 8:18 
GeneralRe: Send CTRL-S And CTRL-X To Open Excel Doc Pin
Kevin Marois15-Oct-09 8:27
professionalKevin Marois15-Oct-09 8:27 
AnswerRe: Send CTRL-S And CTRL-X To Open Excel Doc Pin
Saksida Bojan15-Oct-09 8:26
Saksida Bojan15-Oct-09 8:26 
GeneralRe: Send CTRL-S And CTRL-X To Open Excel Doc Pin
Kevin Marois15-Oct-09 8:28
professionalKevin Marois15-Oct-09 8:28 
GeneralRe: Send CTRL-S And CTRL-X To Open Excel Doc Pin
Saksida Bojan15-Oct-09 8:32
Saksida Bojan15-Oct-09 8:32 
Questioncommunication between two websites in asp.net Pin
noo.dyab15-Oct-09 7:53
noo.dyab15-Oct-09 7:53 
AnswerRe: communication between two websites in asp.net Pin
Dave Kreskowiak15-Oct-09 8:05
mveDave Kreskowiak15-Oct-09 8:05 
GeneralRe: communication between two websites in asp.net Pin
noo.dyab15-Oct-09 9:31
noo.dyab15-Oct-09 9:31 
GeneralRe: communication between two websites in asp.net Pin
Dave Kreskowiak15-Oct-09 11:58
mveDave Kreskowiak15-Oct-09 11:58 
AnswerRe: communication between two websites in asp.net Pin
Richard MacCutchan15-Oct-09 9:30
mveRichard MacCutchan15-Oct-09 9:30 
Questiona table of arraylist Pin
abbd15-Oct-09 7:51
abbd15-Oct-09 7:51 
AnswerRe: a table of arraylist Pin
OriginalGriff15-Oct-09 8:02
mveOriginalGriff15-Oct-09 8:02 
GeneralRe: a table of arraylist Pin
abbd15-Oct-09 8:07
abbd15-Oct-09 8:07 
GeneralRe: a table of arraylist Pin
Luc Pattyn15-Oct-09 8:16
sitebuilderLuc Pattyn15-Oct-09 8:16 
GeneralRe: a table of arraylist Pin
abbd15-Oct-09 8:20
abbd15-Oct-09 8:20 
GeneralRe: a table of arraylist Pin
Saksida Bojan15-Oct-09 8:23
Saksida Bojan15-Oct-09 8:23 
GeneralRe: a table of arraylist Pin
Luc Pattyn15-Oct-09 8:45
sitebuilderLuc Pattyn15-Oct-09 8:45 
GeneralRe: a table of arraylist Pin
Luc Pattyn15-Oct-09 8:47
sitebuilderLuc Pattyn15-Oct-09 8:47 
GeneralRe: a table of arraylist Pin
OriginalGriff15-Oct-09 8:42
mveOriginalGriff15-Oct-09 8:42 
Very simple - just the same as you would for anything else:
private void button1_Click(object sender, EventArgs e)
    {
    ArrayList al = new ArrayList();
    LoadList(al, 0, 3, 1);
    ShowList(al);
    ArrayList[] all = new ArrayList[2];
    all[0] = new ArrayList();
    all[1] = new ArrayList();
    LoadList(all[0], 10, 13, 1);
    LoadList(all[1], 0, 300, 100);
    foreach (ArrayList a in all)
        {
        ShowList(a);
        }
    }

private void ShowList(ArrayList al)
    {
    for (int i = 0; i < al.Count; i++)
        {
        Console.Write(" " + al[i].ToString() + " ");
        }
    Console.WriteLine();
    }

private void LoadList(ArrayList al, int start, int end, int increment)
    {
    for (int i = start; i <= end; i += increment)
        {
        al.Add(i.ToString());
        }
    }


However, I would suggest that rather than an ArrayList, use a List<T> - the usage is very similar.

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.