Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2011.01.30;
Скачать: CL | DM;

Вниз

Напомните о контрлах. InsertControl vs Parent   Найти похожие ветки 

 
12 ©   (2010-11-13 15:50) [0]

это аналогично ведь?

   CB.Buttons[i].Parent := TB;
и
//    B := TBitBtn(CB.Buttons[i]);
//    CB.RemoveControl(CB.Buttons[i]);
//    TB.InsertControl(B);
?


 
han_malign   (2010-11-13 16:08) [1]

блин, а открыть 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);
 ...


 
12 ©   (2010-11-13 17:11) [2]

Спасибо :)
знаю что так можно и так и сделал

ждал просто
может кто разбирался уже и просто скажет да, в принципе
код большой, встретил
//    B := TBitBtn(CB.Buttons[i]);
//    CB.RemoveControl(CB.Buttons[i]);
//    TB.InsertControl(B);

решил переписать

CB.Buttons[i].Parent := TB;

а то и так много всего на странице



Страницы: 1 вся ветка

Текущий архив: 2011.01.30;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.006 c
15-1287174545
Юрий
2010-10-16 00:29
2011.01.30
С днем рождения ! 16 октября 2010 суббота


4-1244384113
dmitry_12_08_73
2009-06-07 18:15
2011.01.30
Конфликт SetWindowsHookEx при быстром 5-тикратном нажатии Shift


15-1287260945
Юрий
2010-10-17 00:29
2011.01.30
С днем рождения ! 17 октября 2010 воскресенье


2-1289589563
samsung
2010-11-12 22:19
2011.01.30
Есть функция IntToBin как разложить строку на биты


15-1287145661
неокубинец
2010-10-15 16:27
2011.01.30
Acer или не Acer?