本文介绍了如何在C#winform应用程序中列出清单视图项中的特定项目图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

private void OnCallStateChanged(object sender, CallStateEventArgs e)
{
    if (this.InvokeRequired)
    {
        EventHandler<callstateeventargs> eh = OnCallStateChanged;
        this.BeginInvoke(eh, new object[] { sender, e });
        return;
    }

    TapiLine line = (TapiLine)sender;
    TapiCall call = e.Call;

    foreach (ListViewItem lvi in Lst_Ext_Status.Items)
    {
        string deep = lvi.Index.ToString();
        if (call.CallState == CallState.Idle)
        {
            lvi.ImageIndex = 1;
        }
        else if (call.CallState == CallState.Dialtone)
        {
            lvi.ImageIndex = 3;
        }
        else if (call.CallState == CallState.Connected)
        {
            lvi.ImageIndex = 3;
        }
        else if (call.CallState == CallState.Offering)
        {
            lvi.ImageIndex = 4;
        }
        else if (call.CallState == CallState.Ringback)
        {
            lvi.ImageIndex = 5;
        }
    }
}

推荐答案

这篇关于如何在C#winform应用程序中列出清单视图项中的特定项目图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 22:56