Click here to Skip to main content
16,005,178 members
Home / Discussions / C#
   

C#

 
GeneralRe: ThreadPool Class Pin
dabuskol19-Apr-04 19:02
dabuskol19-Apr-04 19:02 
GeneralAPI (GetPrivateProfileString) does not understand extention. Pin
mcgahanfl19-Apr-04 8:57
mcgahanfl19-Apr-04 8:57 
Questionhow to add function to Explorer's context menu Pin
Paolo Ponzano19-Apr-04 8:40
Paolo Ponzano19-Apr-04 8:40 
AnswerRe: how to add function to Explorer's context menu Pin
Heath Stewart19-Apr-04 8:54
protectorHeath Stewart19-Apr-04 8:54 
AnswerRe: how to add function to Explorer's context menu Pin
Mike Dimmick19-Apr-04 8:55
Mike Dimmick19-Apr-04 8:55 
AnswerRe: how to add function to Explorer's context menu Pin
Heath Stewart19-Apr-04 8:57
protectorHeath Stewart19-Apr-04 8:57 
GeneralControl Arrays Pin
SanShou19-Apr-04 7:09
SanShou19-Apr-04 7:09 
GeneralRe: Control Arrays Pin
Heath Stewart19-Apr-04 8:50
protectorHeath Stewart19-Apr-04 8:50 
You don't actually declare the variable as Array, but as Control[], which inherits from Array implicitly:
Control[] controls = new Control[]
  {
    myControl1,
    myControl2,
    // ...
  };
for (int i=0; i<controls.Length; i++)
{
  Control c = controls[i];
  if (i == 0) c.Location = new Point(8, 8);
  else c.Location = new Point(8, 8 + controls[i - 1].Location.Y;
  // ...
}
You could also use a collection or list, but then you either have to cast or use a typed collection or list like Control.ControlCollection.

Also, since you need to add your controls to their container's Controls collection property anyway, you can always enumerate them all after adding them and initialize their properties.

 

Microsoft MVP, Visual C#
My Articles
GeneralOpenfiledialog Pin
Appelz19-Apr-04 4:52
Appelz19-Apr-04 4:52 
GeneralRe: Openfiledialog Pin
Jon G19-Apr-04 4:54
Jon G19-Apr-04 4:54 
GeneralRe: Openfiledialog Pin
Heath Stewart19-Apr-04 5:06
protectorHeath Stewart19-Apr-04 5:06 
GeneralRe: Openfiledialog Pin
Heath Stewart19-Apr-04 5:05
protectorHeath Stewart19-Apr-04 5:05 
GeneralNeed help with crystal reports in C# Pin
AAQ19-Apr-04 4:51
AAQ19-Apr-04 4:51 
GeneralRe: Need help with crystal reports in C# Pin
Heath Stewart19-Apr-04 5:09
protectorHeath Stewart19-Apr-04 5:09 
GeneralRe: Need help with crystal reports in C# Pin
AAQ19-Apr-04 19:51
AAQ19-Apr-04 19:51 
GeneralRe: Need help with crystal reports in C# Pin
Heath Stewart20-Apr-04 3:29
protectorHeath Stewart20-Apr-04 3:29 
GeneralC# CF image processing Pin
icem4n19-Apr-04 4:36
icem4n19-Apr-04 4:36 
GeneralRe: C# CF image processing Pin
Heath Stewart19-Apr-04 4:40
protectorHeath Stewart19-Apr-04 4:40 
GeneralRe: C# CF image processing Pin
Christian Graus19-Apr-04 11:47
protectorChristian Graus19-Apr-04 11:47 
GeneralRe: C# CF image processing Pin
icem4n19-Apr-04 17:18
icem4n19-Apr-04 17:18 
GeneralRe: C# CF image processing Pin
Christian Graus19-Apr-04 17:26
protectorChristian Graus19-Apr-04 17:26 
GeneralRe: C# CF image processing Pin
icem4n23-Apr-04 17:11
icem4n23-Apr-04 17:11 
GeneralAI programming using C#.Net Pin
sreejith ss nair19-Apr-04 4:09
sreejith ss nair19-Apr-04 4:09 
GeneralRe: AI programming using C#.Net Pin
Heath Stewart19-Apr-04 4:43
protectorHeath Stewart19-Apr-04 4:43 
GeneralRe: AI programming using C#.Net Pin
Tom Larsen19-Apr-04 6:36
Tom Larsen19-Apr-04 6:36 

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.