rrrrr12345
Programmer
Hi again, thank you for your advices, please give me comments again. Your help will be appreciated.
I have a MainForm which the user can input a number so that each set of data associated with the number is displayed using another form with radio buttons (basically):
e.g. when 'Production 1' is selected in MainForm. The content of an XML file refering to 'Production 1' would be displayed by a TRadioGroup, so, when 'Production 2' is selected, the content of 'Production 2' would be displayed, e.g.
procedure CheckStatusDisplay;
begin
StatusForm.RadioGroup.OnClick := nil;
if (P.Status = 'Accepted') then
StatusForm.RadioGroup.ItemIndex := 0;
if (P.Status = 'Rejected') ) then
StatusForm.RadioGroup.ItemIndex := 1;
// P is the appropriate Production as selected
// This was done when a different Production is selected
StatusForm.RadioGroup.OnClick := StatusForm.RadioGroupClick;
end;
Now, when the user clicks on the RadioButton, the content e.g. Accepted or Rejected, would be saved :
procedure TStatusForm.RadioButton.Click(Sender: TObject);
begin
If StatusForm.RadioButton.ItemIndex = 1 then
P.Status := 'Rejected';
If StatusForm.RadioButton.ItemIndex = 0 then
P.Status := 'Accepted';
end;
Ok, now the problem occurs when I do the following:
(i) Start the program
(ii) Select production 1
//at this point nothing would comes up as we're assuming XML is empty.
(iii) Click on Accepted
// P.Status becomes Accepted.
(iv) Select production 2
// RadioGroup becomes emty again as nothing was saved for production 2
(v) click on Status form but not in the RadioGroup, or click on maximise, etc. Not anywhere in the RadioGroup.
// now for some reason, the program runs procedure TStatusForm.RadioButton.Click(Sender: TObject); and assigned it as accepted (if I clicked rejected before, then rejected would appear)! This is strange, because I only click it at production 1 but why would the onclick event occur even I haven't click into the radiogroup? Remember that the status was re-loaded when I selected Prodcution 2, so how could this happen?
Thanks, thanks so much.
I have a MainForm which the user can input a number so that each set of data associated with the number is displayed using another form with radio buttons (basically):
e.g. when 'Production 1' is selected in MainForm. The content of an XML file refering to 'Production 1' would be displayed by a TRadioGroup, so, when 'Production 2' is selected, the content of 'Production 2' would be displayed, e.g.
procedure CheckStatusDisplay;
begin
StatusForm.RadioGroup.OnClick := nil;
if (P.Status = 'Accepted') then
StatusForm.RadioGroup.ItemIndex := 0;
if (P.Status = 'Rejected') ) then
StatusForm.RadioGroup.ItemIndex := 1;
// P is the appropriate Production as selected
// This was done when a different Production is selected
StatusForm.RadioGroup.OnClick := StatusForm.RadioGroupClick;
end;
Now, when the user clicks on the RadioButton, the content e.g. Accepted or Rejected, would be saved :
procedure TStatusForm.RadioButton.Click(Sender: TObject);
begin
If StatusForm.RadioButton.ItemIndex = 1 then
P.Status := 'Rejected';
If StatusForm.RadioButton.ItemIndex = 0 then
P.Status := 'Accepted';
end;
Ok, now the problem occurs when I do the following:
(i) Start the program
(ii) Select production 1
//at this point nothing would comes up as we're assuming XML is empty.
(iii) Click on Accepted
// P.Status becomes Accepted.
(iv) Select production 2
// RadioGroup becomes emty again as nothing was saved for production 2
(v) click on Status form but not in the RadioGroup, or click on maximise, etc. Not anywhere in the RadioGroup.
// now for some reason, the program runs procedure TStatusForm.RadioButton.Click(Sender: TObject); and assigned it as accepted (if I clicked rejected before, then rejected would appear)! This is strange, because I only click it at production 1 but why would the onclick event occur even I haven't click into the radiogroup? Remember that the status was re-loaded when I selected Prodcution 2, so how could this happen?
Thanks, thanks so much.