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

C#

 
GeneralRe: how do I get the cursor position?? Pin
Stephan Wright19-Jul-04 2:19
Stephan Wright19-Jul-04 2:19 
GeneralRe: how do I get the cursor position?? Pin
Heath Stewart19-Jul-04 3:18
protectorHeath Stewart19-Jul-04 3:18 
GeneralRe: how do I get the cursor position?? Pin
Stephan Wright19-Jul-04 3:53
Stephan Wright19-Jul-04 3:53 
Questionhow to get the supported cryptographic algorithm on current .net platform Pin
noosword18-Jul-04 23:54
noosword18-Jul-04 23:54 
AnswerRe: how to get the supported cryptographic algorithm on current .net platform Pin
Heath Stewart19-Jul-04 2:39
protectorHeath Stewart19-Jul-04 2:39 
GeneralQuestion abt service Pin
SatyaDY18-Jul-04 23:51
SatyaDY18-Jul-04 23:51 
GeneralRe: Question abt service Pin
RB@Emphasys19-Jul-04 6:44
RB@Emphasys19-Jul-04 6:44 
GeneralReferences controls created at runtime Pin
JKtracksub418-Jul-04 21:41
JKtracksub418-Jul-04 21:41 
Hey everyone. Thanks in advance for any help. I have a WIN32 application that I am having difficulties with.

I basically have an ADD button for which you are able to add checkboxes at runtime. Then, I also have a REMOVE button which removes any checkboxes that are checked when the button is pressed. My difficulty lies in how to reference the checkboxes because they are all created at runtime. Here is some of my code.
<br />
function (int currentnumber) {<br />
  <tab>myCheckBox = new System.Windows.Forms.CheckBox();<br />
  this.panel1.Controls.Add(myCheckBox);<br />
  myCheckBox.Location = new System.Drawing.Point(this.Group_label.Left-30, ystarter+(currentNumber*distance));<br />
  myCheckBox.Name = "checkBox"+currentNumber;<br />
  Console.WriteLine(myCheckBox.Name);<br />
  myCheckBox.Size = new System.Drawing.Size(16, 24);<br />
  myCheckBox.TabIndex = 6;<br />
}<br />
<br />
private void Remove_Group_Click(object sender, System.EventArgs e) {<br />
  for(int i=1;i<=totalGroups;i++) {				<br />
    //string namer = "this.checkBox"+i;<br />
    if (checkBox"+i.Checked == true) {<br />
      this.panel1.Controls.Remove(checkBox"+i);<br />
    }<br />
  }<br />
}<br />


My REMOVE button click handler does not work properly. I can't get it to compile because it says that checkBox+i is not a valid Checkbox.

How do I reference my checkboxes that were created at runtime whose names should be:
checkBox1,checkBox2,....

Thanks again for any help.
GeneralRe: References controls created at runtime Pin
Heath Stewart19-Jul-04 2:51
protectorHeath Stewart19-Jul-04 2:51 
GeneralCast Problem Pin
Reinier van de Wetering18-Jul-04 21:28
Reinier van de Wetering18-Jul-04 21:28 
GeneralRe: Cast Problem Pin
mav.northwind18-Jul-04 21:47
mav.northwind18-Jul-04 21:47 
GeneralRe: Cast Problem Pin
Reinier van de Wetering18-Jul-04 22:16
Reinier van de Wetering18-Jul-04 22:16 
GeneralRe: Cast Problem Pin
RB@Emphasys19-Jul-04 6:48
RB@Emphasys19-Jul-04 6:48 
QuestionCrystal Reports: Bad performance on some Win2000 systems? Pin
Pain_Elemental18-Jul-04 18:05
Pain_Elemental18-Jul-04 18:05 
AnswerRe: Crystal Reports: Bad performance on some Win2000 systems? Pin
Daniel Turini19-Jul-04 6:09
Daniel Turini19-Jul-04 6:09 
GeneralRe: Crystal Reports: Bad performance on some Win2000 systems? Pin
Pain_Elemental19-Jul-04 20:57
Pain_Elemental19-Jul-04 20:57 
GeneralProblem with Stored Procedure's Return value Pin
ronin177018-Jul-04 15:23
ronin177018-Jul-04 15:23 
GeneralRe: Problem with Stored Procedure's Return value Pin
woudwijk18-Jul-04 21:19
woudwijk18-Jul-04 21:19 
GeneralRe: Problem with Stored Procedure's Return value Pin
dishanf19-Jul-04 1:19
dishanf19-Jul-04 1:19 
GeneralCalling richTextBox from other namespaces many times Pin
evdoxos18-Jul-04 13:53
evdoxos18-Jul-04 13:53 
GeneralRe: Calling richTextBox from other namespaces many times Pin
Judah Gabriel Himango18-Jul-04 14:48
sponsorJudah Gabriel Himango18-Jul-04 14:48 
GeneralRe: Calling richTextBox from other namespaces many times Pin
evdoxos18-Jul-04 23:00
evdoxos18-Jul-04 23:00 
GeneralMenu like Windows Start menu Pin
webhay18-Jul-04 10:03
webhay18-Jul-04 10:03 
GeneralRe: Menu like Windows Start menu Pin
Heath Stewart19-Jul-04 3:07
protectorHeath Stewart19-Jul-04 3:07 
GeneralRe: Menu like Windows Start menu Pin
webhay19-Jul-04 7:37
webhay19-Jul-04 7:37 

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.