Неявное обращение к компонентам, манипуляции в run-time Delphi — среда быстрой разработки, где в качестве языка программирования используется Object Pascal. На сегодняшний день позволяет разрабатывать ПО для Microsoft Windows, Mac OS, iOS и Android и входит в состав Embarcadero RAD Studio https://delphi-hlp.ru/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time.feed 2022-09-13T04:28:22+07:00 Delphi help info@delphi-hlp.ru Joomla! - Open Source Content Management Групповые опперации с контролами 2017-08-04T20:10:04+07:00 2017-08-04T20:10:04+07:00 https://delphi-hlp.ru/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/gruppovye-opperatsii-s-kontrolami.html Super User toto44@inbox.ru <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Если например эти 10 CheckBox все время используются для групповых операций, чтобы не перебирать компоненты можно сделать так.</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">1) Берем ставим на форму 10 CheckBox</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">2) объявляем массив</span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">var</span><span class="f_CodeExample" style="color: #000000;"> arr:</span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">array</span><span class="f_CodeExample" style="color: #000000;">[</span><span class="f_CodeExample" style="color: #800000;">1</span><span class="f_CodeExample" style="color: #000000;">..</span><span class="f_CodeExample" style="color: #800000;">10</span><span class="f_CodeExample" style="color: #000000;">] </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">of</span><span class="f_CodeExample" style="color: #000000;"> TCheckBox</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p class="feed-readmore"><a target="_blank" href ="/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/gruppovye-opperatsii-s-kontrolami.html">Подробнее...</a></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Если например эти 10 CheckBox все время используются для групповых операций, чтобы не перебирать компоненты можно сделать так.</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">1) Берем ставим на форму 10 CheckBox</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">2) объявляем массив</span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">var</span><span class="f_CodeExample" style="color: #000000;"> arr:</span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">array</span><span class="f_CodeExample" style="color: #000000;">[</span><span class="f_CodeExample" style="color: #800000;">1</span><span class="f_CodeExample" style="color: #000000;">..</span><span class="f_CodeExample" style="color: #800000;">10</span><span class="f_CodeExample" style="color: #000000;">] </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">of</span><span class="f_CodeExample" style="color: #000000;"> TCheckBox</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p class="feed-readmore"><a target="_blank" href ="/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/gruppovye-opperatsii-s-kontrolami.html">Подробнее...</a></p> Как найти компонент по имени? 2017-08-04T20:01:42+07:00 2017-08-04T20:01:42+07:00 https://delphi-hlp.ru/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/kak-najti-komponent-po-imeni.html Super User toto44@inbox.ru <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Обратится к компоненту по имени можно например так, если стоит 10 CheckBox - от CheckBox1 до CheckBox10 то</span></p> <p> </p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">For</span><span class="f_CodeExample" style="color: #000000;"> i:=</span><span class="f_CodeExample" style="color: #800000;">1</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">to</span> <span class="f_CodeExample" style="color: #800000;">10</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">do</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;"> (FindComponent(Format(</span><span class="f_CodeExample" style="color: #ff0000;">'CheckBox%d'</span><span class="f_CodeExample" style="color: #000000;">,[i])) </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">as</span><span class="f_CodeExample" style="color: #000000;"> TCheckBox).checked:=true;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff0000; font-weight: bold;">Автор:</span> <span style="color: #0000ff; font-weight: bold; text-decoration: underline;"><a class="weblink" href="https://www.delphist.com/" target="_blank" rel="noopener noreferrer"><strong>Vit</strong></a></span> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Взято с Vingrad.ru </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Обратится к компоненту по имени можно например так, если стоит 10 CheckBox - от CheckBox1 до CheckBox10 то</span></p> <p> </p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">For</span><span class="f_CodeExample" style="color: #000000;"> i:=</span><span class="f_CodeExample" style="color: #800000;">1</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">to</span> <span class="f_CodeExample" style="color: #800000;">10</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">do</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;"> (FindComponent(Format(</span><span class="f_CodeExample" style="color: #ff0000;">'CheckBox%d'</span><span class="f_CodeExample" style="color: #000000;">,[i])) </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">as</span><span class="f_CodeExample" style="color: #000000;"> TCheckBox).checked:=true;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff0000; font-weight: bold;">Автор:</span> <span style="color: #0000ff; font-weight: bold; text-decoration: underline;"><a class="weblink" href="https://www.delphist.com/" target="_blank" rel="noopener noreferrer"><strong>Vit</strong></a></span> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Взято с Vingrad.ru </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> Как отловить смену фокуса для всех контролов? 2017-08-04T21:39:14+07:00 2017-08-04T21:39:14+07:00 https://delphi-hlp.ru/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/kak-otlovit-smenu-fokusa-dlya-vsekh-kontrolov.html Super User toto44@inbox.ru <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">procedure</span><span class="f_CodeExample" style="color: #000000;"> TForm1.ActiveControlChange(Sender: TObject);</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">{©Drkb v.3(2007): www.drkb.ru}</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;"> Caption := TScreen(Sender).ActiveForm.ActiveControl.</span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">Name</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">procedure</span><span class="f_CodeExample" style="color: #000000;"> TForm1.FormCreate(Sender: TObject);</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Screen.OnActiveControlChange := ActiveControlChange;</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> </span></p> <p style="text-align: right;"><span style="color: #ff6600; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff0000; font-weight: bold;">Автор:</span> <span style="color: #0000ff; font-weight: bold;">p0s0l</span></span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Взято с Vingrad.ru </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">procedure</span><span class="f_CodeExample" style="color: #000000;"> TForm1.ActiveControlChange(Sender: TObject);</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">{©Drkb v.3(2007): www.drkb.ru}</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;"> Caption := TScreen(Sender).ActiveForm.ActiveControl.</span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">Name</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">procedure</span><span class="f_CodeExample" style="color: #000000;"> TForm1.FormCreate(Sender: TObject);</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Screen.OnActiveControlChange := ActiveControlChange;</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> </span></p> <p style="text-align: right;"><span style="color: #ff6600; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff0000; font-weight: bold;">Автор:</span> <span style="color: #0000ff; font-weight: bold;">p0s0l</span></span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Взято с Vingrad.ru </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> Как создать контрол в Run-Time? 2017-08-04T21:36:08+07:00 2017-08-04T21:36:08+07:00 https://delphi-hlp.ru/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/kak-sozdat-kontrol-v-run-time.html Super User toto44@inbox.ru <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">var</span><span class="f_CodeExample" style="color: #000000;"> Butt:TButton;</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">{©Drkb v.3(2007): www.drkb.ru}</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Butt:=TButton.Create(Self);</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Butt.Parent:=self;</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Butt.Visible:=true;</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p style="text-align: right;"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff6600; font-weight: bold;">©</span><span style="color: #ff6600; font-weight: bold;">Drkb::00356</span></span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff0000; font-weight: bold;">Автор:</span> <span style="color: #0000ff; font-weight: bold; text-decoration: underline;">Fantasist</span></span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"><strong>Взято с Vingrad.ru</strong></span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">var</span><span class="f_CodeExample" style="color: #000000;"> Butt:TButton;</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">{©Drkb v.3(2007): www.drkb.ru}</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Butt:=TButton.Create(Self);</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Butt.Parent:=self;</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Butt.Visible:=true;</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p style="text-align: right;"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff6600; font-weight: bold;">©</span><span style="color: #ff6600; font-weight: bold;">Drkb::00356</span></span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff0000; font-weight: bold;">Автор:</span> <span style="color: #0000ff; font-weight: bold; text-decoration: underline;">Fantasist</span></span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"><strong>Взято с Vingrad.ru</strong></span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> Обращение через свойство Controls 2017-08-04T21:37:20+07:00 2017-08-04T21:37:20+07:00 https://delphi-hlp.ru/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/obrashchenie-cherez-svojstvo-controls.html Super User toto44@inbox.ru <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">procedure</span><span class="f_CodeExample" style="color: #000000;"> TForm1.UpDown1Click(Sender: TObject; Button: TUDBtnType);</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">{©Drkb v.3(2007): www.drkb.ru}</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">var</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> I: Integer;</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> ChildControl: TControl;</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;"> for</span><span class="f_CodeExample" style="color: #000000;"> I:= </span><span class="f_CodeExample" style="color: #800000;">0</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">to</span><span class="f_CodeExample" style="color: #000000;"> GroupBox1.ControlCount -</span><span class="f_CodeExample" style="color: #800000;">1</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">do</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">    ChildControl := GroupBox1.Controls[I];</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;">    ChildControl.Top := ChildControl.Top + </span><span class="f_CodeExample" style="color: #800000;">15</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;"> end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Проверить тип контрола надо оператором is:</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #008000; font-weight: bold;">if</span> edit1 <span style="color: #008000; font-weight: bold;">is</span> TEdit <span style="color: #008000; font-weight: bold;">then</span>....</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Затем доступ ко всем свойствам путем приведения класса:</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">(edit1 <span style="color: #008000; font-weight: bold;">as</span> TEdit).text:=<span style="color: #ff0000;">''</span>; </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #008000; font-weight: bold;">Автор ответа:</span> <span style="color: #ff0000;">Kiber_rat</span></span></p> <p style="text-align: right;"><span style="color: #ff6600; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Взято с Vingrad.ru </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">procedure</span><span class="f_CodeExample" style="color: #000000;"> TForm1.UpDown1Click(Sender: TObject; Button: TUDBtnType);</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">{©Drkb v.3(2007): www.drkb.ru}</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">var</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> I: Integer;</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> ChildControl: TControl;</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;"> for</span><span class="f_CodeExample" style="color: #000000;"> I:= </span><span class="f_CodeExample" style="color: #800000;">0</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">to</span><span class="f_CodeExample" style="color: #000000;"> GroupBox1.ControlCount -</span><span class="f_CodeExample" style="color: #800000;">1</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">do</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">    ChildControl := GroupBox1.Controls[I];</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;">    ChildControl.Top := ChildControl.Top + </span><span class="f_CodeExample" style="color: #800000;">15</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;"> end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Проверить тип контрола надо оператором is:</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #008000; font-weight: bold;">if</span> edit1 <span style="color: #008000; font-weight: bold;">is</span> TEdit <span style="color: #008000; font-weight: bold;">then</span>....</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Затем доступ ко всем свойствам путем приведения класса:</span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">(edit1 <span style="color: #008000; font-weight: bold;">as</span> TEdit).text:=<span style="color: #ff0000;">''</span>; </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #008000; font-weight: bold;">Автор ответа:</span> <span style="color: #ff0000;">Kiber_rat</span></span></p> <p style="text-align: right;"><span style="color: #ff6600; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Взято с Vingrad.ru </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> Перебор всех компонентов на форме 2017-08-04T19:48:03+07:00 2017-08-04T19:48:03+07:00 https://delphi-hlp.ru/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/perebor-vsekh-komponentov-na-forme.html Super User toto44@inbox.ru <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Например, надо найти все TCheckBox на форме и установить их все в положение checked:</span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">var</span><span class="f_CodeExample" style="color: #000000;"> i: integer;</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">for</span><span class="f_CodeExample" style="color: #000000;"> i := </span><span class="f_CodeExample" style="color: #800000;">0</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">to</span><span class="f_CodeExample" style="color: #000000;"> ComponentCount - </span><span class="f_CodeExample" style="color: #800000;">1</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">do</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;">    </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">if</span><span class="f_CodeExample" style="color: #000000;"> Components[i] </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">is</span><span class="f_CodeExample" style="color: #000000;"> TCheckBox </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">then</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;">      (Components[i] </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">as</span><span class="f_CodeExample" style="color: #000000;"> TCheckBox).Checked := true;</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff0000; font-weight: bold;">Автор:</span> <span style="color: #0000ff; font-weight: bold; text-decoration: underline;"><strong>Vit</strong></span> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #000000; font-weight: bold;">Взято с Vingrad.ru</span> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Например, надо найти все TCheckBox на форме и установить их все в положение checked:</span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">var</span><span class="f_CodeExample" style="color: #000000;"> i: integer;</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">for</span><span class="f_CodeExample" style="color: #000000;"> i := </span><span class="f_CodeExample" style="color: #800000;">0</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">to</span><span class="f_CodeExample" style="color: #000000;"> ComponentCount - </span><span class="f_CodeExample" style="color: #800000;">1</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">do</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;">    </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">if</span><span class="f_CodeExample" style="color: #000000;"> Components[i] </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">is</span><span class="f_CodeExample" style="color: #000000;"> TCheckBox </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">then</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #000000;">      (Components[i] </span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">as</span><span class="f_CodeExample" style="color: #000000;"> TCheckBox).Checked := true;</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #ff0000; font-weight: bold;">Автор:</span> <span style="color: #0000ff; font-weight: bold; text-decoration: underline;"><strong>Vit</strong></span> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span style="color: #000000; font-weight: bold;">Взято с Vingrad.ru</span> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> Работа с массивом компонентов 2017-08-04T21:41:17+07:00 2017-08-04T21:41:17+07:00 https://delphi-hlp.ru/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/rabota-s-massivom-komponentov.html Super User toto44@inbox.ru <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Автор: RoboSol.</span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Часто возникают вопросы о работе с массивом компонентов. вот пример того как вывести список имен всех компонентов в приложении.</span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">procedure</span><span class="f_CodeExample" style="color: #000000;"> TForm1.Button1Click(Sender : TObject);</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">{©Drkb v.3(2007): www.drkb.ru}</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">var</span><span class="f_CodeExample" style="color: #000000;"> i : integer;</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> ListBox1.Items.Clear;</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">for</span><span class="f_CodeExample" style="color: #000000;"> i:=</span><span class="f_CodeExample" style="color: #800000;">0</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">to</span><span class="f_CodeExample" style="color: #000000;"> ComponentCount-</span><span class="f_CodeExample" style="color: #800000;">1</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">do</span><span class="f_CodeExample" style="color: #000000;"> ListBox1.Items.Add(Components[i].</span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">Name</span><span class="f_CodeExample" style="color: #000000;">);</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p class="feed-readmore"><a target="_blank" href ="/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/rabota-s-massivom-komponentov.html">Подробнее...</a></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">Автор: RoboSol.</span></p> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> Часто возникают вопросы о работе с массивом компонентов. вот пример того как вывести список имен всех компонентов в приложении.</span></p> <div style="margin: 7px 0px; padding: 0px; text-align: justify; text-indent: 0px;"> <table style="border-width: 1px; border-style: solid; border-color: #000000 #c0c0c0 #c0c0c0 #000000; border-spacing: 0px; background-color: #ffffc4;" border="1" cellspacing="0" cellpadding="5" bgcolor="#ffffc4"> <tbody> <tr align="left" valign="top"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p style="text-align: justify;"><span style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">Code:</span></p> </td> </tr> <tr align="left"> <td style="border-width: 1px; border-style: solid; border-color: #c0c0c0 #000000 #000000 #c0c0c0;"> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">procedure</span><span class="f_CodeExample" style="color: #000000;"> TForm1.Button1Click(Sender : TObject);</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000080; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;">{©Drkb v.3(2007): www.drkb.ru}</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">var</span><span class="f_CodeExample" style="color: #000000;"> i : integer;</span></span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #008000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt; font-weight: bold;">begin</span></p> <p class="p_CodeExample"><span class="f_CodeExample" style="color: #000000; font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> ListBox1.Items.Clear;</span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">for</span><span class="f_CodeExample" style="color: #000000;"> i:=</span><span class="f_CodeExample" style="color: #800000;">0</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">to</span><span class="f_CodeExample" style="color: #000000;"> ComponentCount-</span><span class="f_CodeExample" style="color: #800000;">1</span> <span class="f_CodeExample" style="color: #008000; font-weight: bold;">do</span><span class="f_CodeExample" style="color: #000000;"> ListBox1.Items.Add(Components[i].</span><span class="f_CodeExample" style="color: #008000; font-weight: bold;">Name</span><span class="f_CodeExample" style="color: #000000;">);</span></span></p> <p class="p_CodeExample"><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"><span class="f_CodeExample" style="color: #008000; font-weight: bold;">end</span><span class="f_CodeExample" style="color: #000000;">;</span></span></p> </td> </tr> </tbody> </table> </div> <p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: 12pt;"> </span></p> <p class="feed-readmore"><a target="_blank" href ="/index.php/neyavnoe-obrashchenie-k-komponentam-manipulyatsii-v-run-time/rabota-s-massivom-komponentov.html">Подробнее...</a></p>