Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

Value List Editor and SetEditorText

hello,

i have a problem using the value list editor as usual , i  need to make some changes
in my memo1 when the user edit the cell text but this resulted an infinite
loop causing EStackOverFlaw,
cause each time memo1.setfocus is executed in the value editor setedittext
event , the setedittext is fired again and again and again (probably
because the valuelisteditor loses focus or something),

procedure TFrmMain.vleSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: String);
begin
memo1.SelText := 'blabla';
--stuff---
memo11.SetFocus;
end;

how to solve this?, i read about using OnExit event but i need the SetEditText event to
access the old and new "value" variable,
any ideas?

Thanks In A
Yehia
0
yehiaeg
Asked:
yehiaeg
  • 4
  • 3
1 Solution
 
esoftbgCommented:
I tested, but have not EStackOverFlow ????
0
 
esoftbgCommented:
I have not Exception at all. Just Memo11 is Focused....
0
 
esoftbgCommented:
I'll be back after 12 - 16 hours ....
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
yehiaegAuthor Commented:
i ensure it does, i debug it line by line and when i reach memo1.SetFocus the debugger move to the top of of SetEditText event
0
 
esoftbgCommented:
Okay, you are right, when I Click on a ValueListEditor's Cell it raises an Event :
SetEditText(....);
Because inside this event performs:
  memo1.SetFocus;
it rises 4 times:
SetEditText(....);
but I have not exception ....

emil
0
 
yehiaegAuthor Commented:
maybe because there is a few lines written in your SetEditText, i have about 30 lines of code and it does repeat itself continuously (not 4 times), any ideas?
0
 
yehiaegAuthor Commented:
oops, i discovered that changing maintext.selstart causes the loop because when changing it the maintext SelChanged is fired wich also fires SetEdittext again...

Sorry for wasting your time.
Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now