[Gambas-user] make Label background from Database field

Doriano Blengino doriano.blengino at ...1909...
Sun Oct 18 22:37:55 CEST 2009


Vassilis K ha scritto:
> After the function of change_bgcolor that existed and Benoit reminded us, the 
> code is becoming more sophisticated: 
>
> PUBLIC SUB Form_Open()
>   DIM rsThesi AS Result
>   DIM iTemp AS Integer
>   DIM sTemp AS String
>    MODMain.Connect()
>    rsThesi = MODMain.$Con.exec("select * from egrafes where elenchosAnax = 0 
> AND thesi <> 0 ")
>    DO WHILE rsThesi.Index < rsThesi.Count - 1
>         change_bgcolor("Label" & CInt(rsThesi!thesi))
>         rsThesi.MoveNext()
>    LOOP
> END
>
> SUB change_bgcolor(labelname AS String)
>   Form1[labelName].Background = Color.Red
> END
>   
At this point, there is no need for a separate subroutine -> the single 
instruction inside it can replace the calling of it.

Anyway, Benoit, did you read the other messages? There were strange 
things...

Regards,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."





More information about the User mailing list