Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am developing an application for pocket pc (so compact framework), this application will contain many tabpages with many controls on each. At certain points i will need to run through a list of strings calling methods from the control with the ID property matching the list entry. My current thinking is that I could achieve this by doing something abit like this....

 

// For each Item on list
for(int i = 0; i < myStrings.Length; i++)
{
 // For each Page
 for(int j = 0; j < TabPages.TabPages.Count; j++)
 {
   // For each Control
   for(int k = 0; k < TabPages[j].Controls.Count; k++)
   {
     If(myStrings[i] == TabPages[j].Controls[k].ID)
     {
       //Call Method
       bFound = true;
       break;
     }
   }
   if(bFound)
   {
     bFound = false;
     break;
 }
}

 

But this seems like it could be really slow... Another way I thought about doing it would be as I add each control to a tab page, I also add a reference to it to an arraylist. That way I would only have to loop through the list, and the arraylist.

 

The problem with this is I'm worried it would use alot of resourse which are in short supply with the PocketPC.

 

So my question really is, will that method be much quicker, and how many more resources is it likely to use...

Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...