Peter Kiers
asked on
A dbrichedit question.
Hi,
I have these procedures and they use the dbrichedit1.
The dbrichedit1 is on the PageControl's tab with align = alClient.
procedure TMainForm.PlayBtnClick(Sen der: TObject);
begin
if not BeenPaused then
SpVoice1.Speak(DBRichEdit1 .Text, SVSFlagsAsync) <=====
else
begin
SpVoice1.Resume;
BeenPaused := False
end
end;
procedure TMainForm.SetTextHilite(Fi rstChar, Len: Integer);
begin
DBRichEdit1.SelStart := FirstChar; <========
DBRichEdit1.SelLength := Len; <=========
end;
procedure TMainForm.SetTextStyle(Fir stChar, Len: Integer; Styles: TFontStyles);
begin
with DBRichEdit1 do <=========
begin
Lines.BeginUpdate;
try
SelStart := FirstChar;
SelLength := Len;
SelLength := 0;
finally
Lines.EndUpdate
end
end
end;
But know I made a button that creates the tabs of the pagecontrol (and the dbrichedit on it) dynamicly.
What do I have to alter in the code to get the active dbrichedit .
Peter
I have these procedures and they use the dbrichedit1.
The dbrichedit1 is on the PageControl's tab with align = alClient.
procedure TMainForm.PlayBtnClick(Sen
begin
if not BeenPaused then
SpVoice1.Speak(DBRichEdit1
else
begin
SpVoice1.Resume;
BeenPaused := False
end
end;
procedure TMainForm.SetTextHilite(Fi
begin
DBRichEdit1.SelStart := FirstChar; <========
DBRichEdit1.SelLength := Len; <=========
end;
procedure TMainForm.SetTextStyle(Fir
begin
with DBRichEdit1 do <=========
begin
Lines.BeginUpdate;
try
SelStart := FirstChar;
SelLength := Len;
SelLength := 0;
finally
Lines.EndUpdate
end
end
end;
But know I made a button that creates the tabs of the pagecontrol (and the dbrichedit on it) dynamicly.
What do I have to alter in the code to get the active dbrichedit .
Peter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
and i get incompatible types: TDBRichedit and TComponent
at line: Redit := PageControl1.ActivePage.Co mponents[i ];
P.
at line: Redit := PageControl1.ActivePage.Co
P.
ASKER
I got it. 500 points are comming to you.
Greetings, Peter Kiers
Greetings, Peter Kiers
Sorry for the delay, I was busy and not on line.
I coded on the fly so there was a typo (missing the typecast TDBRichedit(PageControl1.A ctivePage. Components [i])
I'm glad that you solved it the same by you (maybe looking at the prevoius code ;-))
Thanx fo the points and best regards.
Ferruccio
I coded on the fly so there was a typo (missing the typecast TDBRichedit(PageControl1.A
I'm glad that you solved it the same by you (maybe looking at the prevoius code ;-))
Thanx fo the points and best regards.
Ferruccio
ASKER
procedure TMainForm.PlayBtnClick(Sen
begin
if not BeenPaused then
SpVoice1.Speak(DBRichEdit1
else
begin
SpVoice1.Resume;
BeenPaused := False
end
end;
procedure TMainForm.SetTextStyle(Fir
begin
with DBRichEdit1 do <=========
begin
Lines.BeginUpdate;
try
SelStart := FirstChar;
SelLength := Len;
SelLength := 0;
finally
Lines.EndUpdate
end
end
end;
Peter