473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Checkbox array question (Program stops responding)

4
I need to associate the elements of a bool type matrix with the state of a checkbox from an array that i've created. For example: if the element checkBoxMatrix[3,4] is checked then the the element in boolMatrix[3,4] is changed to true and if it is unchecked it is changed to false. However; this is not my problem.

The size of the matrices aren't fixed. I dynamically allocate the number of rows and columns.It works fine when the ranges are small, but when these ranges become kind of big, for example 100 by 100, the program stops responding.

I would like to stick with the array of checkboxes since I'm kind of new with C#, but creating a table (like in Exel, if there is a way) on the form would suffice.

Any and all ideas are welcome...
Dec 6 '07 #1
3 1567
Frinavale
9,735 Expert Mod 8TB
I need to associate the elements of a bool type matrix with the state of a checkbox from an array that i've created. For example: if the element checkBoxMatrix[3,4] is checked then the the element in boolMatrix[3,4] is changed to true and if it is unchecked it is changed to false. However; this is not my problem.

The size of the matrices aren't fixed. I dynamically allocate the number of rows and columns.It works fine when the ranges are small, but when these ranges become kind of big, for example 100 by 100, the program stops responding.

I would like to stick with the array of checkboxes since I'm kind of new with C#, but creating a table (like in Exel, if there is a way) on the form would suffice.

Any and all ideas are welcome...
Could you please post the code that you are using to dynamically allocate the memory for your arrays?

Are you sure that you are properly cleaning up the memory once you are finished with it?

(Is this a web application or desktop application?)
Dec 6 '07 #2
Jakes
4
****This is the code where I create the array:
Expand|Select|Wrap|Line Numbers
  1. this.ActCondState=new System.Windows.Forms.CheckBox[this.ruleType.GetNumOfRules(),this.ruleType.GetNumOfAct() + this.ruleType.GetNumOfCond()];
  2.  
  3. j=40;
  4.  
  5. this.checkBoxDimension1 = this.ruleType.GetNumOfRules();
  6. this.checkBoxDimension2 = this.ruleType.GetNumOfAct() + this.ruleType.GetNumOfCond();
  7.  
  8. //Creates the checkboxes which maintain the state of each entry in the decision matrix
  9. for(k=0;k<this.checkBoxDimension1;++k)
  10. {
  11.      int o=30;
  12.      for(l=0;l<this.checkBoxDimension2;++l)
  13.      {
  14.         this.ActCondState[k,l] = new System.Windows.Forms.CheckBox();
  15.         if(this.ruleType.GetDecisionMatrixElem(k,l) == true)
  16.     this.ActCondState[k,l].Checked =true;
  17.         this.ActCondState[k,l].CheckStateChanged += new EventHandler
  18.         mainFrm_CheckStateChanged);
  19.         this.ActCondState[k,l].Location = new System.Drawing.Point(j,o);
  20.         this.ActCondState[k,l].Size =new System.Drawing.Size(30,20);
  21.         this.ActCondState[k,l].Name = "ActCondState"+k+"_"+l; 
  22.         this.RuleTypePopulateTab.Controls.AddRange(new
  23.         System.Windows.Forms.Control[]  {this.ActCondState[k,l]});
  24.         o+=20;
  25.       }
  26.       j+=40;
  27. }
  28.  
  29. //****This is the code where i dispose of each individual checkbox:
  30.  
  31. if(ActCondState != null)
  32. {
  33.           for(k=0;k<this.checkBoxDimension1;++k)
  34.     for(l=0;l<this.checkBoxDimension2;++l)
  35.     {
  36.           this.ActCondState[k,l].Dispose();
  37.     }
  38. }
  39.  
Thank you for your response
Dec 7 '07 #3
Jakes
4
Oh, and its a desktop application.
Dec 7 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: claudel | last post by:
Hi I have a newb PHP/Javascript question regarding checkbox processing I'm not sure which area it falls into so I crossposted to comp.lang.php and comp.lang.javascript. I'm trying to...
7
by: Rodney King | last post by:
Hi, I have developed an ASP page which dynamically displays a list of checkbox options based on a SQL statement. Here is my code: <div style="OVERFLOW:auto; Height: 150px"> <table> <% dim...
0
by: Michael Bourgon | last post by:
I've been having the same problem for 2 weeks now. If anyone has any ideas, I'd love to hear them. We are using both SQL and Windows Authentication. I was running a Profiler Trace at the time,...
4
by: Piotr | last post by:
how can I read (in alert for example) array index number of checked checkbox? I have: <input type="checkbox" id="id_number" name="check" value="1" onclick="show()"/> <input type="checkbox"...
10
by: Nimit | last post by:
Hi, I wasn't sure which forum this post belongs to, so I've posted it to a couple forums that I thought may be appropriate. In giving me advice, please consider me a beginner. Below is a synopsis...
9
by: Craig Andrews | last post by:
Hello, How do I access HTML CheckBoxs in the codebehind section of an ASP.NET program? In the old Interdev days one would: For i = 1 to Request.Form("CheckBox").Count if...
2
by: gce | last post by:
What happens : When I first press the button, I get an listbox1 with a,b,c (correct: because of the addtoa(1, "a") addtoa(2, "b") addtoa(3, "c") When I check the checkbox, the eventhandler...
1
by: Sluggoman | last post by:
Hi all, Am floundering through a course in which C was not a pre-req, but the assignment is in C - If someone could point out where I am going way off the rails, I'd apprecciate it. Please be...
8
by: Sunny | last post by:
Hi, Can someone tell me, How to redefine array or make array empty or null. Here what I am trying to do. var temp = new Array(); for(i=0; i <=outstring.length-1; i++) { temp =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.