Forum > Designer

how change index of component in a groupBox?

(1/4) > >>

Weiss:
its is not the first time I run into this issue. Apparently location of control in a groupBox doesn't mean this is how they will be iterated. How do I change the index of contained component?

I remember in the past deleting the whole groupbox and starting anew. Maybe there is a simple way of fixing the iterator for contained components? Can't find online. My delphi book is at home, 500 km away.

KodeZwerg:
I am not sure what you mean with Index since a TGroupBox is not having such a property.
However, iterating over the controls inside a TGroupBox, their order is defined in the .lfm file, in most cases it is defined at creating the TGroupBox, how you visual display them has no impact.

Weiss:

--- Quote from: KodeZwerg on January 23, 2024, 02:05:51 am ---I am not sure what you mean with Index since a TGroupBox is not having such a property.
However, iterating over the controls inside a TGroupBox, their order is defined in the .lfm file, in most cases it is defined at creating the TGroupBox, how you visual display them has no impact.

--- End quote ---

by index I mean that little pesky 'i' within [] brackets. You know, the integer one.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---TSomeComponent(groupBoxSomething.Controls[ i ]).ComponentProperty := newValue;By now I figured that components are displayed in object inspector in order they will be iterated. The user, however, does not have control over that order, other than deleting components and placing them again, paying particular attention to have them in correct sequence.

I was just wondering if there was easier way. Some deeply secret backdoor, only cool programmers would know.

KodeZwerg:

--- Quote from: Weiss on January 23, 2024, 02:17:02 am ---Some deeply secret backdoor, only cool programmers would know.
--- End quote ---
Sorry that my 100% correct and working answer is not cool enough for you, happy day and good doing!

Weiss:
looking in .lfm file was a good suggestion. Haven't tried shuffling chunks of code in .lfm file, it appeared safer to re-populate groupBox, and probably quicker too.

It is just strange, there is "tab order", but no iteration sequence number for grouped components. Would be cool if component could be just dragged up or down the list in object inspector. Or if user could enter correct sequential number in properties, something like that.

Navigation

[0] Message Index

[#] Next page

Go to full version