Jump to content

Как перебрать все элементы на форма/фрейме?


dbf_usr

Recommended Posts

for i := 0 to ComponentCount-1 do 
 if Components[i] is TEdit then 
  (Components[i] as TEdit).Color := clRed;

Вот такой код работает в VCL приложениях. В UniGUI не нащел ни у форм ни у фреймов свойств Componets. За ранее не известно сколько элементов на форме, нужно обойти все. Как это сделать?

Link to comment
Share on other sites

19 hours ago, dbf_usr said:

for i := 0 to ComponentCount-1 do 
 if Components[i] is TEdit then 
  (Components[i] as TEdit).Color := clRed;

Вот такой код работает в VCL приложениях. В UniGUI не нащел ни у форм ни у фреймов свойств Componets. За ранее не известно сколько элементов на форме, нужно обойти все. Как это сделать?

uses uniGUIForm, uniGUIFrame


for z := 0 to AForm.ComponentCount - 1 do
        AForm.Components[z]

for z := 0 to AFrame.ComponentCount - 1 do
        AFrame.Components[z]

 

Пробовал у себя работает

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...