![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Напомните о контрлах. InsertControl vs Parent
12 © (2010-11-13 15:50:00)это аналогично ведь?
CB.Buttons[i].Parent := TB;
и
// B := TBitBtn(CB.Buttons[i]);
// CB.RemoveControl(CB.Buttons[i]);
// TB.InsertControl(B);
?
12 (2010-11-13 17:11:00) [1]Спасибо :)
знаю что так можно и так и сделал
ждал просто
может кто разбирался уже и просто скажет да, в принципе
код большой, встретил
// B := TBitBtn(CB.Buttons[i]);
// CB.RemoveControl(CB.Buttons[i]);
// TB.InsertControl(B);
решил переписать
CB.Buttons[i].Parent := TB;
а то и так много всего на странице
han_malign (2010-11-13 16:08:00) [2]блин, а открыть Controls.pas - религия не позволяет???
procedure TControl.SetParent(AParent: TWinControl);
begin
if FParent <> AParent then
begin
if AParent = Self then
raise EInvalidOperation.CreateRes(@SControlParentSetToSelf);
if FParent <> nil then
FParent.RemoveControl(Self);
if AParent <> nil then
begin
AParent. InsertControl(Self);
UpdateAnchorRules;
end;
end;
end;
...
procedure TWinControl.Insert(AControl: TControl);
begin
if AControl <> nil then
begin
if AControl is TWinControl then
begin
ListAdd(FWinControls, AControl);
ListAdd(FTabList, AControl);
end else
ListAdd(FControls, AControl);
AControl.FParent := Self;
end;
end;
...
procedure TWinControl.InsertControl(AControl: TControl);
var
Item: TControlListItem;
begin
AControl.ValidateContainer(Self);
Item.Control := AControl;
Item.Parent := Self;
Perform(CM_CONTROLLISTCHANGING, Integer(@Item), Integer(True));
Perform(CM_CONTROLLISTCHANGE, Integer(AControl), Integer(True));
Insert(AControl);
...