- Moderator
- #1
Hi community,
I have some problems to set an image in the OnMessage function. I have a listcontrol and a image control on my window and everytime i change the focus of the list control item, i set a property item with a filename of an image on my hard drive. In my skin file i use the property i set in my code. The problem is that, if i scroll down or up in the listcontrol, the image changes not everytime in the image control. Sometimes the image control changes to the right image and sometimes the image control is empty.
I use the following code:
Hope someone can help me out :/
Greets edsche
I have some problems to set an image in the OnMessage function. I have a listcontrol and a image control on my window and everytime i change the focus of the list control item, i set a property item with a filename of an image on my hard drive. In my skin file i use the property i set in my code. The problem is that, if i scroll down or up in the listcontrol, the image changes not everytime in the image control. Sometimes the image control changes to the right image and sometimes the image control is empty.
I use the following code:
Code:
public override bool OnMessage(GUIMessage message)
{
switch (message.Message)
{
case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED:
{
int iControl = message.SenderControlId;
if (iControl == 50)
{
GUIListItem item = GUIControl.GetSelectedListItem(GetID, 50);
if (item != null)
{
foreach (Feed feed in FeedService.Feeds)
{
if (feed.Active)
{
GUIPropertyManager.SetProperty("#image", feed.FeedItems[listcontrol.SelectedListItemIndex].Enclosure);
break;
}
}
}
}
}
break;
}
return base.OnMessage(message);
}
Hope someone can help me out :/
Greets edsche