Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 4 Jahren, 10 Monaten
Letzter Beitrag:
vor 4 Jahren, 10 Monaten
Beteiligte Autoren:
Arie, Alan Evans, Al, Ian

Selected Row Colour - List Box - WM17 - Android

Startbeitrag von Alan Evans am 07.11.2012 16:24

Hi,

This should be a really easy one, but I'll be damned if I can get it working ! How do i just set the row colour of a selected item (in the Row_Selected Event) in a list box on Android? If I try and set either the brushcolor or the color, nothing happens!

many thanks

Alan

Antworten:

Just a thought (haven't tried it) but can't you set the selected row colour from the IDE : Style tab, Selected Row (Element dropdown) then select Bckgrd Color.

Or do you specifically need to do this programatically at RunTime ?

At Run Time (In WinDev) :

lstMyListBox [ lstMyListBox..Value]..BrushColor = myDesiredColour (say, LightRed)

You'll have to remember to cycle through all of the list box items each time to reset any previously selected row colour to its 'normal' colour...

HTH

Ian

von Ian - am 07.11.2012 17:14
From memory: I couldn't make this work either and hadn;t much time.
I ended up adding a static control behind the other controls in a row. And change the color of this static control instead of the looper row.

von Arie - am 07.11.2012 21:16
Mmh, I see now you are talking about a listbox. Not the looper?

von Arie - am 07.11.2012 21:17
Hello Alan

I use gPen() in list boxes in Windev - maybe it also works on Android.
ListAdd(MySelf..Name,gPen(LInactiveTxtColour)+gBackground(LInactiveBGrndColour)+

Regards
Al

von Al - am 08.11.2012 00:38
Thanks to all for suggestions. I got Ian's idea working on one listbox, but on another one it failed, bizarre! Same code, just different plane, started to complain about zero subscript. So I just set a Label control instead. After several incantations of Windev, I've sorta got used to the fact that about 75% of it actually works as it should !

Thanks

Alan

von Alan Evans - am 13.11.2012 12:16
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.