Zrobiłem 3 zakładki w PageControl. Procedura
procedure TMainForm.Log(AText : string);
begin
if AText <> '' then
begin
if sPageControl1.ActivePage = Menu then
LogMemo3.Lines.Add(Format(Log_Format, [FormatDateTime(Time_Format, Time), AText]));
if sPageControl1.ActivePage = Kategorie then
LogMemo4.Lines.Add(Format(Log_Format, [FormatDateTime(Time_Format, Time), AText]));
if sPageControl1.ActivePage = Filmy then
LogMemo2.Lines.Add(Format(Log_Format, [FormatDateTime(Time_Format, Time), AText]));
AText := '';
end;
end;
powinna wyświetlać informacje tylko na jednym RichEdit.
Oprogramowałem funkcję
procedure TMainForm.sPageControl1PageChanging(Sender: TObject;
NewPage: TsTabSheet; var AllowChange: Boolean);
var
ThreadId : Cardinal;
begin
if (NewPage = Kategorie) and (CatLB.Items.Count <= 0) then
CreateThread(nil, 0, @GetCatThreadProc, Pointer(RefreshBtnHandle), 0, ThreadId);
end;
, gdzie
procedure GetCatThreadProc(Param : Pointer); stdcall;
var
I : integer;
DocStr : string;
CatSL : TStringList;
begin
with MainForm do
begin
EnableWindow(HWND(Param), False);
CatSL := TStringList.Create;
Log('Wyszukuję listę kategorii...');
.....
Problem w tym, że jak przełączę się na zakładkę Kategorie, to wyświetla dobrze, ale po zmianie zakładki na inną Wyświetla się też w rej zakładce. Gdzie zrobiłem błąd?