[Gambas-user] make Label background from Database field

Matti math.eber at ...221...
Thu Oct 15 07:27:00 CEST 2009


I guess that "Label(["i"])" causes the problem.
I don't think you can address them that way, but need an array of labels.

Here, it works with
PRIVATE $alblTime AS NEW Object[]
$alblTime[i] = NEW Label(ME)

And then you can address every label with
$alblTime[i].Property = xy

Regards
Matti


Vassilis K schrieb:
> Hello,
> I want to change the color of about 100 Labels of a form according to the 
> values of a table in the database.
> If the value of the field thesi is 12, I want to make Label12 look red (with 
> red background color).
> For this purpose I made the following :
> 
> PUBLIC SUB Form_Open()
>   DIM rsThesi AS Result
>   DIM i AS Integer
>   ME.Title = "Sxedio"
>   MODMain.Connect()
>     rsThesi = MODMain.$Con.exec("select * from egrafes where elenchosAnax = 
> 0")
> 	FOR iD = 0 TO rsThesi!AA
>              i = rsThesi!thesi
>              Label(["i"]).Background = Color.Red 
>        NEXT
>     MODMain.$Con.Commit()
> END
> 
> But I get the error :
> "Type mismatch: Wanted Label got string instead"
> Any ideas?
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 




More information about the User mailing list