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

C#

 
GeneralRe: ThreadPool Class Pin
Heath Stewart19-Apr-04 9:14
protectorHeath Stewart19-Apr-04 9:14 
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 
I was just wondering if there is a way to do a control array for ease of setting up some controls. Basically I am trying to do this (syntax is more psuedo code):

<br />
controlA_View1.Top = controlA_View2.Top;<br />
controlA_View1.Left = controlA_View2.Left;<br />
controlA_View1.Visible = false;<br />
<br />
controlB_View1.Top = controlB_View2.Top;<br />
controlB_View1.Left = controlB_View2.Left;<br />
controlB_View1.Visible = false;<br />
<br />
...<br />
<br />
controlN_View1.Top = controlN_View2.Top;<br />
controlN_View1.Left = controlN_View2.Left;<br />
controlN_View1.Visible = false;<br />
<br />


I was wondering if I could do this:

<br />
// Assume all controls were inserted by the designer<br />
Array arrView1;<br />
arrView1.Add(controlA_View1);<br />
arrView1.Add(controlB_View1);<br />
...<br />
arrView1.Add(controlN_View1);<br />
<br />
Array arrView2;<br />
arrView2.Add(controlA_View2);<br />
arrView2.Add(controlB_View2);<br />
...<br />
arrView2.Add(controlN_View2);<br />
<br />
for(int i = 0; i < arrView1.Count() && i < arrView2.Count(); i ++)<br />
{<br />
   // Not casting even though I know array returns an object<br />
   arrView1[i].Top = arrView2[i].Top;<br />
   arrView1[i].Left = arrView2[i].Left;<br />
   arrView2[i].Visible = false;<br />
}<br />


I am adding the controls via the form desinger because it is obviously easier to lay them out. I am using my current home project to explore deeper in to C# however I know I could do something like this with pointers or maybe with unsafe code. I remember the ref keyword can cause a reference to be passed to a function but can a ref be passed to an array?

Thanks for any help...
Brian

If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
GeneralRe: Control Arrays Pin
Heath Stewart19-Apr-04 8:50
protectorHeath Stewart19-Apr-04 8:50 
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 

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.