• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • 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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
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

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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