<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=63&amp;t=20837&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2018-06-06T22:34:41+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=63&amp;t=20837&amp;mode</id>
<entry>
<author><name><![CDATA[ozi22]]></name></author>
<updated>2018-06-06T22:34:41+01:00</updated>
<published>2018-06-06T22:34:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208671#p208671</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208671#p208671"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208671#p208671"><![CDATA[
Lepszym rozwiązaniem będzie:<br /><br />[syntax=vb]Sub Zmiana_Koloru(tag As String,R As Int,G As Int,B As Int)<br />For Each v As View In Activity.GetAllViewsRecursive<br /><br />If v Is Button Then<br /> <br />If v.Tag ==tag Then<br />Dim Button_temp As Button = v<br />Button_temp.Color=Colors.RGB(R,G,B)<br />  <br />End If<br />End If<br /><br />Next<br /> <br />End Sub[/syntax]<br /><br />Po If v.Tag ==tag Then lepiej dodać<br />Dim Button_temp As Button = v<br />Button_temp.Color=Colors.RGB(R,G,B)<br />ponieważ teraz mamy dostęp do wszystkich właściwości Buttona np <br /><br />Button.Text<br /><br />w poprzedniej wersji do tego nie było dostępu.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=11876">ozi22</a> — 6 cze 2018, o 22:34</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[szpilek]]></name></author>
<updated>2018-06-06T19:42:59+01:00</updated>
<published>2018-06-06T19:42:59+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208663#p208663</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208663#p208663"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208663#p208663"><![CDATA[
sprytnie, brawo!!<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2485">szpilek</a> — 6 cze 2018, o 19:42</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ozi22]]></name></author>
<updated>2018-06-06T19:20:45+01:00</updated>
<published>2018-06-06T19:20:45+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208662#p208662</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208662#p208662"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208662#p208662"><![CDATA[
Dziękuję za porady.<br />Panie Mirku IFy lub CASEy to by było najłatwiejsze rozwiązanie i na 100% by działało ale pisanie ponad 100 IFów to takie masochistyczne, w ostateczności na tym bym skończył ale znalazłem pewne rozwiązanie mianowicie:<br />-każdy Button , Label czy ImageView ma opcję Tag  (Button.Tag) tak sie złożyło ze w Designerze przy tworzeniu przycisków w Tagu wpisywałem też jego nazwę i oto ten Tag został wykorzystany do stworzenia funkcji która po tym tagu odwołuje się do danego Butona i zmienia kolor (choć też można sie odwołać do Labela itd)<br /><br />[syntax=vb]Sub Zmiana_Koloru(Button_tag As String,R As Int,G As Int,B As Int)<br /> <br />         For Each v As View In Activity.GetAllViewsRecursive<br /><br />If v Is Button Then<br /> <br />If v.Tag ==Button_tag Then<br />v.Color=Colors.RGB(R,G,B)<br /><br />End If<br /><br />End If<br />Next<br /> <br />End Sub[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=11876">ozi22</a> — 6 cze 2018, o 19:20</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2018-06-06T16:39:21+01:00</updated>
<published>2018-06-06T16:39:21+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208649#p208649</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208649#p208649"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208649#p208649"><![CDATA[
<div class="quotetitle">ozi22 napisał(a):</div><div class="quotecontent"><br />ale narazie stoje w miejscu<br /></div><br />Twoja wina - bo dostałeś już podpowiedź od kolegi tfosik ... zastosuj że IFy albo CASE'y i po ptakach ...<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 6 cze 2018, o 16:39</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ozi22]]></name></author>
<updated>2018-06-06T16:22:29+01:00</updated>
<published>2018-06-06T16:22:29+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208648#p208648</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208648#p208648"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208648#p208648"><![CDATA[
<div class="quotetitle">tfosik napisał(a):</div><div class="quotecontent"><br />Może spróbuj tego:<br /><!-- m --><a class="postlink" href="https://www.b4x.com/android/forum/threads/b4x-xui-xcustomlistview-cross-platform-customlistview.84501/" >https://www.b4x.com/android/forum/threa ... iew.84501/</a><!-- m --><br /></div><br /><br />Dziekuje za próby pomocy ale narazie stoje w miejscu<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=11876">ozi22</a> — 6 cze 2018, o 16:22</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[tfosik]]></name></author>
<updated>2018-06-06T14:01:28+01:00</updated>
<published>2018-06-06T14:01:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208644#p208644</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208644#p208644"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208644#p208644"><![CDATA[
Może spróbuj tego:<br /><!-- m --><a class="postlink" href="https://www.b4x.com/android/forum/threads/b4x-xui-xcustomlistview-cross-platform-customlistview.84501/" >https://www.b4x.com/android/forum/threa ... iew.84501/</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=18769">tfosik</a> — 6 cze 2018, o 14:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ozi22]]></name></author>
<updated>2018-06-06T13:10:20+01:00</updated>
<published>2018-06-06T13:10:20+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208640#p208640</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208640#p208640"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208640#p208640"><![CDATA[
<div class="quotetitle">szpilek napisał(a):</div><div class="quotecontent"><br />spróbuj:<br /><br />[syntax=vb]Sub Zmiana_koloru(nazwa_przycisku as String, R as Int, G as Int, B as Int)<br />  Dim button= Me.Controls.Find(nazwa_przycisku, True)<br />  If button.Length &gt; 0 then<br />    nazwa_przycisku.Color=Colors.RGB(R,G,B)<br />  End If<br />End Sub[/syntax]<br /><br />PS. używaj więcej googla, jak sam coś znajdziesz to się szybciej nauczysz:D<br /></div><br /><br />W VB to na pewno działa natomiast w Basic 4 Android niestety nie.<br />W B4A nie ma czegoś takiego jak Me.Controls.Find()<br />natomiast jest   &quot;Me&quot; ale po &quot;Me.&quot; nic sie nie podpowiada<br /><br />ale i tak dziękuje za zainteresowanie!!<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=11876">ozi22</a> — 6 cze 2018, o 13:10</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[szpilek]]></name></author>
<updated>2018-06-06T12:12:53+01:00</updated>
<published>2018-06-06T12:12:53+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208639#p208639</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208639#p208639"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208639#p208639"><![CDATA[
spróbuj:<br /><br />[syntax=vb]Sub Zmiana_koloru(nazwa_przycisku as String, R as Int, G as Int, B as Int)<br />  Dim button= Me.Controls.Find(nazwa_przycisku, True)<br />  If button.Length &gt; 0 then<br />    nazwa_przycisku.Color=Colors.RGB(R,G,B)<br />  End If<br />End Sub[/syntax]<br /><br />PS. używaj więcej googla, jak sam coś znajdziesz to się szybciej nauczysz:D<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2485">szpilek</a> — 6 cze 2018, o 12:12</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ozi22]]></name></author>
<updated>2018-06-06T11:57:36+01:00</updated>
<published>2018-06-06T11:57:36+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208638#p208638</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208638#p208638"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208638#p208638"><![CDATA[
Działa jeżeli do funkcji przekazuje argument jako object typu Button<br /><br />a ja chciałbym zrobić coś w stylu jak działa Callsub(&quot;nazwa funckcji&quot; as String)<br />np:<br />//funkcje button Click<br />Sub ButtonOK_Click<br /><br />End Sub<br /><br />Sub ButtonUP_Click<br /><br />End Sub<br /><br />i np poprzez Call sub moge odwołac sie do funkcji w ten sposób:<br /><br />dim  nazwa_przycisku as String<br />Callsub(nazwa_przycisku &amp; &quot;_Click&quot;)  //to działa<br /><br /><br />i chcę zrobic podobną funkcje która jako argument przyjmuje nazwe_przycisku jako String i Inty jako kolory RGB.<br />Cały czas kombinuje jak zamienić String na nazwe objektu typu Button(czy coś tego typu)<br /><br />to by mi ułatwiło sprawe bo w moim programie mam bardzo dużą ilośc przycisków i w miare rozwoju programu bedą dynamicznie dodawane(mam taka nadzieje)<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=11876">ozi22</a> — 6 cze 2018, o 11:57</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[tfosik]]></name></author>
<updated>2018-06-06T11:21:02+01:00</updated>
<published>2018-06-06T11:21:02+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208637#p208637</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208637#p208637"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208637#p208637"><![CDATA[
Witam <br />użyj select case, np. ponumeruj sobie przyciski<br />[syntax=vb]Dim value As int ' do tej zmiennej wstaw numer przycisku który nadleci<br /><br />Select value <br />Case 1<br />nazwa_przycisku1.Color=Colors.RGB(R,G,B)<br />Case 2<br />nazwa_przycisku2.Color=Colors.RGB(R,G,B)<br />Case 3<br />nazwa_przycisku3.Color=Colors.RGB(R,G,B)<br />Case Else<br /><br />End Select[/syntax]<br /><br />P.S. To kolejna z opcji ale skoro funkcja twoja działa no to co ty chcesz właściwie zrobić ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=18769">tfosik</a> — 6 cze 2018, o 11:21</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[szpilek]]></name></author>
<updated>2018-06-06T09:56:07+01:00</updated>
<published>2018-06-06T09:56:07+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208633#p208633</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208633#p208633"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208633#p208633"><![CDATA[
a to inna bajka<br />nie wiem jak jest w visual basicu ale w c# jest funkcja Controls.Find<br />musisz szukać czegoś podobnego<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2485">szpilek</a> — 6 cze 2018, o 09:56</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ozi22]]></name></author>
<updated>2018-06-06T09:31:52+01:00</updated>
<published>2018-06-06T09:31:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208631#p208631</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208631#p208631"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208631#p208631"><![CDATA[
<div class="quotetitle">szpilek napisał(a):</div><div class="quotecontent"><br />nie znam B4A, ale zgaduję, że nazwa_przycisku powinna być typu obiekt, na pewno nie string<br /></div><br /><br /><br />Dziękuję za zainteresowanie,<br /><br />jeżeli zrobię tak :<br /><br />  Sub Zmiana_koloru(nazwa_przycisku as Button , R as Int, G as Int, B as Int)   //nazwa_przycisku jako Button<br /><br />   nazwa_przycisku.Color=Colors.RGB(R,G,B)<br /><br />  End Sub<br />to działa z tym że chodzi mi o to żeby to działało w ten sposób jak np: CallSub(&quot;nazwa_funkcji&quot; as String)<br />ponieważ dane które odbieram po UDP z ESP8266 są typu string i wygląda to np. tak <br /><br />dane as String =&quot;nazwa_przycisku&quot;200,50,10#<br />potem to parsuje<br />i mam Stringa &quot;nazwa_przycisku&quot; i trzy Inty<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=11876">ozi22</a> — 6 cze 2018, o 09:31</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2018-06-06T09:25:40+01:00</updated>
<published>2018-06-06T09:25:40+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208630#p208630</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208630#p208630"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208630#p208630"><![CDATA[
dokładnie - OBIEKT a nie String przekaż jako pierwszy argument funkcji<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 6 cze 2018, o 09:25</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[szpilek]]></name></author>
<updated>2018-06-06T09:17:03+01:00</updated>
<published>2018-06-06T09:17:03+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208629#p208629</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208629#p208629"/>
<title type="html"><![CDATA[Re: B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208629#p208629"><![CDATA[
nie znam B4A, ale zgaduję, że nazwa_przycisku powinna być typu obiekt, na pewno nie string<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2485">szpilek</a> — 6 cze 2018, o 09:17</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ozi22]]></name></author>
<updated>2018-06-06T09:09:58+01:00</updated>
<published>2018-06-06T09:09:58+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208628#p208628</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208628#p208628"/>
<title type="html"><![CDATA[B4A zmiana koloru przycisków]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20837&amp;p=208628#p208628"><![CDATA[
Witam, na początku chciałem zaznaczyć że jestem świeżak jeśli chodzi o programowanie i mam pewien problem, mianowicie:<br />w aplikacji mam bardzo dużą ilość przycisków (Buttonów) i jak do tej pory zmieniam ich kolor w taki sposób:<br /><br />np:   Button_ON.Color=Colors.Green   lub Button_ON.Color=Colors.RGB(0,250,0)<br /><br />i czy jest możliwość stworzenia Sub tego typu:<br /><br /> Sub Zmiana_koloru(nazwa_przycisku as String, R as Int, G as Int, B as Int)<br /><br />           nazwa_przycisku.Color=Colors.RGB(R,G,B)<br /> End Sub<br /><br />nie wiem jak zamienić Stringa na nazwę przycisku<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=11876">ozi22</a> — 6 cze 2018, o 09:09</p><hr />
]]></content>
</entry>
</feed>