Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2009.02.22;
Скачать: [xml.tar.bz2];

Вниз

Hide Tab inside TabControl ?   Найти похожие ветки 

 
Dodfr   (2007-12-13 12:01) [0]

Hello, I am trying to hide some tabsheet into into tabcontrol but cannot find to right function.

I tried many but none work, my tab and its content is still visible.

   MyTab.Children[0].Visible:=false;
   MyTab.TC_Pages[0].Visible:=false;
   TabPage_0.Visible:=false;

All thoses are unefficient.

Regards.


 
SergeR ©   (2007-12-13 12:41) [1]

TabControl create some TKOLPanels, like TabControl_Tab1.
Use TabControl_Tab1.visible := false


 
Dodfr   (2007-12-13 12:53) [2]

TabPage_0 is the name of one of the TKolPanel tab inside TabControl so  TabPage_0.Visible:=false; was supposed to do it but it stay visible.


 
Дмитрий К ©   (2007-12-13 12:54) [3]

TC_Remove


 
Dodfr   (2007-12-13 13:02) [4]

TC_Remove is not good solution for me as it destroy all controls inside the pane so to make it reapper again I must do a TC_Insert and recreate all its content.

I just want to show/hide tabs as VCL TabSheet.visible do.


 
Дмитрий К ©   (2007-12-13 13:16) [5]


> it destroy all controls inside the pane

It does not.
What version of KOL you use?

var p: PControl; s: string;
begin
 s:= TabControl1.TC_Items[0];
 p := TabControl1.TC_Remove(0);
 TabControl1.TC_InsertControl(0,s,0,p);
end;


 
Dodfr   (2007-12-13 14:10) [6]

OK that"s a workaround, but not very easy to use and will be more complicated if I have to manage more than two tabs, here what I do :

OnFormShow :

 sSheetHTTP := TabControlExternalDataGrabber.TC_Items[0];
 pSheetHTTP := TabControlExternalDataGrabber.TC_Pages[0];
 sSheetFile := TabControlExternalDataGrabber.TC_Items[1];
 pSheetFile := TabControlExternalDataGrabber.TC_Pages[1];
 TabControlExternalDataGrabber.TC_Remove(1); //keep only first one at startup

Then in have a list inwhich I click and depending which entry I select SheetHTTP or SheetFile will be showed/hidden (other sheets ar visible but will not need to switch visible/invisible) :

if want to to show sheetHTTP and hide sheetFile :

TabControlExternalDataGrabber.TC_Remove(0);
TabControlExternalDataGrabber.TC_InsertControl(0,sSheetHTTP,0,pSheetHTTP);

or do invert :

TabControlExternalDataGrabber.TC_Remove(0);
TabControlExternalDataGrabber.TC_InsertControl(0,sSheetFile,0,pSheetFile);

That works but so many lines for a "so simple" .visible VCL-like property :-(



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

Форум: "KOL";
Текущий архив: 2009.02.22;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.02 c
2-1231179500
Andrnow
2009-01-05 21:18
2009.02.22
Сохранение всех открытых документов в MDI приложении одним кликом


15-1229590972
cvg
2008-12-18 12:02
2009.02.22
Где найти dbexpmysql.dll для MySQL 4.1?


2-1231656525
pavelkq
2009-01-11 09:48
2009.02.22
Пропорциональный ресайз картинки под Imagelist и DrawGrid


2-1228673231
dr_creigan
2008-12-07 21:07
2009.02.22
Excel


15-1230521035
Slider007
2008-12-29 06:23
2009.02.22
С днем рождения ! 29 декабря 2008 понедельник





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский