[SOLVED] Component inheritance lazarus / 7-LCL ---------------------------------------------------------------------- pcurtis · 2021-10-21 17:03 How can I test if a component is derived from TControl or is a visual component? ---------------------------------------------------------------------- devEric69 · 2021-10-21 17:12 Hello, Already 2 simple ways (having said that, I thought that the proper of a control, was to be visual, but well... I don't see where the trap is). So, here is my dummy: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if (oMyComponent is TControl) then ...\...else if (oMyComponent is TWinControl) then ...\... or Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if (oMyComponent.InheritsFrom(TControl)) then ...\...else if (oMyComponent.InheritsFrom(TWinControl)) then ...\... ---------------------------------------------------------------------- pcurtis · 2021-10-21 17:17 Thanks ---------------------------------------------------------------------- howardpc · 2021-10-21 19:10 In fact the simple testCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if oMyComponent.InheritsFrom(TControl) then ...is sufficient. TWinControl is a TControl descendant.