Click here to Skip to main content
15,886,110 members
Home / Discussions / C#
   

C#

 
QuestionInheritance Pin
Besinci27-Jun-06 11:24
Besinci27-Jun-06 11:24 
AnswerRe: Inheritance Pin
Wjousts27-Jun-06 11:31
Wjousts27-Jun-06 11:31 
GeneralRe: Inheritance Pin
Judah Gabriel Himango27-Jun-06 13:05
sponsorJudah Gabriel Himango27-Jun-06 13:05 
AnswerRe: Inheritance Pin
Elina Blank27-Jun-06 11:34
sitebuilderElina Blank27-Jun-06 11:34 
QuestionRe: Inheritance Pin
BoneSoft27-Jun-06 12:38
BoneSoft27-Jun-06 12:38 
Questionforms Pin
Mohammed Elkholy27-Jun-06 11:20
Mohammed Elkholy27-Jun-06 11:20 
AnswerRe: forms Pin
Jun Du27-Jun-06 13:36
Jun Du27-Jun-06 13:36 
QuestionHelp please: Naming the objects at runtime! Pin
Rojan Gh.27-Jun-06 11:17
professionalRojan Gh.27-Jun-06 11:17 
Hi everyone!
I've got a problem, coding in C#!
I have to create some PictureBox controls at runtime and the number of these will be specified at runtime too. Next, I should be able to target them by the name.
I mean I have to be able to generate the names as I need, at runtime, something like this:

<br />
for(int x = 0; x < xCount; x++){<br />
   for(int y = 0; y <yCount; y++){<br />
      public PictureBox "PictureBoxX"+x.ToString()+Y+Y.ToString() = new PictureBox();<br />
   }<br />
}<br />


and then I should be able to access the control by its name and also be able to assign its properties!

There is a function in Javascript and Actionscript that make the object accesible at runtime by generating its name:

<br />
piece3 = "dangerous";<br />
x = 3; <br />
y = eval("piece" add x);<br />
trace(y);        // Output: dangerous.<br />


or

<br />
name1 = "mike";<br />
name2 = "debbie";<br />
name3 = "logan";<br />
for(i = 1; i <= 3; i++) {<br />
    trace (eval("name" add i));        // Output: mike, debbie, logan<br />


but I couldn't find such a thing in C#!

Please help me with this!Frown | :( ((Sigh | :sigh:

Sojaner!
AnswerRe: Help please: Naming the objects at runtime! [modified] Pin
Wjousts27-Jun-06 11:28
Wjousts27-Jun-06 11:28 
AnswerRe: Help please: Naming the objects at runtime! Pin
Rojan Gh.28-Jun-06 2:35
professionalRojan Gh.28-Jun-06 2:35 
AnswerRe: Help please: Naming the objects at runtime! Pin
Guffa27-Jun-06 13:28
Guffa27-Jun-06 13:28 
AnswerRe: Help please: Naming the objects at runtime! Pin
Rojan Gh.28-Jun-06 2:48
professionalRojan Gh.28-Jun-06 2:48 
AnswerRe: Help please: Naming the objects at runtime! Pin
Guffa28-Jun-06 9:40
Guffa28-Jun-06 9:40 
AnswerRe: Help please: Naming the objects at runtime! [modified] Pin
Rojan Gh.28-Jun-06 12:08
professionalRojan Gh.28-Jun-06 12:08 
AnswerRe: Help please: Naming the objects at runtime! Pin
Guffa28-Jun-06 20:14
Guffa28-Jun-06 20:14 
QuestionOpen Web form from Mdi form Pin
Saamir27-Jun-06 11:16
Saamir27-Jun-06 11:16 
AnswerRe: Open Web form from Mdi form Pin
led mike27-Jun-06 11:20
led mike27-Jun-06 11:20 
QuestionEvaluating a mathematical equation from a string [modified] Pin
Xodiak27-Jun-06 10:33
Xodiak27-Jun-06 10:33 
AnswerRe: Evaluating a mathematical equation from a string Pin
Josh Smith27-Jun-06 10:49
Josh Smith27-Jun-06 10:49 
AnswerRe: Need a way to jump to record. [modified] Pin
PyroManiak27-Jun-06 10:40
PyroManiak27-Jun-06 10:40 
QuestionDragDrop of buttons to TabControl Pin
For_IT27-Jun-06 9:53
For_IT27-Jun-06 9:53 
QuestionSaving Unicode characters Pin
For_IT27-Jun-06 9:46
For_IT27-Jun-06 9:46 
AnswerRe: Saving Unicode characters Pin
For_IT27-Jun-06 9:58
For_IT27-Jun-06 9:58 
QuestionDebug CompactFramework app on local PC? Pin
QuiJohn27-Jun-06 9:06
QuiJohn27-Jun-06 9:06 
AnswerRe: Debug CompactFramework app on local PC? Pin
Gavin Roberts27-Jun-06 23:20
Gavin Roberts27-Jun-06 23:20 

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.