J
jerry
I wrote a ton of code in the older VC 6.0 and admit to being behind
the times.
I struggled through and prototyped an application in 2005.net VB that
I am now converting to VC++ in 2005.net, not sharp. To begin with,
the following code clears all the checkbox controls in a groupbox of
60 checks. It works but I think it could be simplified.
For instance, I don't get the "^" character but it has something to do
with high level or system level classes???
But in the code below, if I don't define "h" with CheckBox^ then I
can't get this assignment to work "h = (CheckBox^)this->GroupBox4-
comparison goes true when the control indexed by "x" in Groupbox4 is a
CheckBox.
tThe bottom line is that I shouldn't need to use "b" and should be
able to extract the type from "h" or some other system type for a
checkbox.
This is a long way to say I would like to eliminate 'b' in the
following routine. If you can shed some light on "^" in the process,
I would appreciate it.
thanks,
Jerry
{
CheckBox^ h;
CheckBox b;
int x;
for(x=1; x < this->GroupBox4->Controls->Count; x++)
{
if(this->GroupBox4->Controls[x]->GetType() ==b.GetType() ) // why b?
{
h = (CheckBox^)this->GroupBox4->Controls[x]; // why ^?
h->Checked=false;
}
}
}
the times.
I struggled through and prototyped an application in 2005.net VB that
I am now converting to VC++ in 2005.net, not sharp. To begin with,
the following code clears all the checkbox controls in a groupbox of
60 checks. It works but I think it could be simplified.
For instance, I don't get the "^" character but it has something to do
with high level or system level classes???
But in the code below, if I don't define "h" with CheckBox^ then I
can't get this assignment to work "h = (CheckBox^)this->GroupBox4-
hand side. So, by using the "^" I can't get the comparison "if (this-Controls[x];" no matter how many times I tried to typedef the right
in "==h->GetType()". So I used a dummy CheckBox variable, "b" and theGroupBox4->Controls[x]->GetType() ==b.GetType() )" to work by subbing
comparison goes true when the control indexed by "x" in Groupbox4 is a
CheckBox.
tThe bottom line is that I shouldn't need to use "b" and should be
able to extract the type from "h" or some other system type for a
checkbox.
This is a long way to say I would like to eliminate 'b' in the
following routine. If you can shed some light on "^" in the process,
I would appreciate it.
thanks,
Jerry
{
CheckBox^ h;
CheckBox b;
int x;
for(x=1; x < this->GroupBox4->Controls->Count; x++)
{
if(this->GroupBox4->Controls[x]->GetType() ==b.GetType() ) // why b?
{
h = (CheckBox^)this->GroupBox4->Controls[x]; // why ^?
h->Checked=false;
}
}
}