Smobiler上海石磨_.NET移动开发平台

标题: MobileUserControl的BackgroundImage无法动态改变 [打印本页]

作者: xuyily    时间: 2024-3-3 20:19
标题: MobileUserControl的BackgroundImage无法动态改变
如题!我的用户控件是用作listview的模板

如果是设计时设置了背景图片,那么运行时会显示背景图片


如果是在listview的row_bind事件里动态修改模板的背景图片,那么运行时时不会显示更改的图片的。如下代码所示无法显示图片
private void listViewPayment_RowBind(object sender, ListViewTemplateBindEventArgs e)
        {
            rowFormat(e.Row.Control, e.Data);
            this.Form.Client.RenderFlush();
        }


public void rowFormat(MobileUserControl tpl, object obj)
        {
            CollectionRecord collectionRecord = (CollectionRecord)obj;
            PaymentTpl paymentTpl = (PaymentTpl)tpl;
            if(collectionRecord.DataStatus == -1)
            {
                paymentTpl.BackColor = Color.FromArgb(70,255,153,153);
                //paymentTpl.lblID.LineThrough = true;
                paymentTpl.BackgroundImage = "voided128"; //此处改变背景不会生效

                FindLabel(paymentTpl);
            }


        }


作者: Lula.Jin    时间: 2024-3-4 10:28
我们会测试这个问题的





欢迎光临 Smobiler上海石磨_.NET移动开发平台 (https://www.smobiler.com/) Powered by Discuz! X3.2