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...
3 1545
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?)
****This is the code where I create the array: -
this.ActCondState=new System.Windows.Forms.CheckBox[this.ruleType.GetNumOfRules(),this.ruleType.GetNumOfAct() + this.ruleType.GetNumOfCond()];
-
-
j=40;
-
-
this.checkBoxDimension1 = this.ruleType.GetNumOfRules();
-
this.checkBoxDimension2 = this.ruleType.GetNumOfAct() + this.ruleType.GetNumOfCond();
-
-
//Creates the checkboxes which maintain the state of each entry in the decision matrix
-
for(k=0;k<this.checkBoxDimension1;++k)
-
{
-
int o=30;
-
for(l=0;l<this.checkBoxDimension2;++l)
-
{
-
this.ActCondState[k,l] = new System.Windows.Forms.CheckBox();
-
if(this.ruleType.GetDecisionMatrixElem(k,l) == true)
-
this.ActCondState[k,l].Checked =true;
-
this.ActCondState[k,l].CheckStateChanged += new EventHandler
-
mainFrm_CheckStateChanged);
-
this.ActCondState[k,l].Location = new System.Drawing.Point(j,o);
-
this.ActCondState[k,l].Size =new System.Drawing.Size(30,20);
-
this.ActCondState[k,l].Name = "ActCondState"+k+"_"+l;
-
this.RuleTypePopulateTab.Controls.AddRange(new
-
System.Windows.Forms.Control[] {this.ActCondState[k,l]});
-
o+=20;
-
}
-
j+=40;
-
}
-
-
//****This is the code where i dispose of each individual checkbox:
-
-
if(ActCondState != null)
-
{
-
for(k=0;k<this.checkBoxDimension1;++k)
-
for(l=0;l<this.checkBoxDimension2;++l)
-
{
-
this.ActCondState[k,l].Dispose();
-
}
-
}
-
Thank you for your response
Oh, and its a desktop application.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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,...
|
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"...
|
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...
|
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...
|
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...
|
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...
|
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 =...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
| |