/// <summary> /// Fill combo boxes (Audio/Video device and Audio/Video input line (if avilable)) /// </summary> /// <param name="pDevice"></param> /// <param name="strType"></param> /// <param name="cbxType"></param> private void FillCombo(string strType, ComboBox cbxType) { cbxType.Items.Clear(); cbxType.Tag = strType; int nCount = 0; //Get device count / input line count m_objLive.DeviceGetCount(0, strType, out nCount); cbxType.Enabled = nCount > 0; if (nCount > 0) { for (int i = 0; i < nCount; i++) { string strName; string strDesc; //Get deveice / input line m_objLive.DeviceGetByIndex(0, strType, i, out strName, out strDesc); cbxType.Items.Add(strName); } string strCur = ""; string strParam = ""; int nIndex = 0; try { //Check if there is already selected device / input line m_objLive.DeviceGet(strType, out strCur, out strParam, out nIndex); cbxType.SelectedIndex = !string.IsNullOrEmpty(strCur) ? cbxType.FindStringExact(strCur) : 0; } catch { cbxType.SelectedIndex = 0; } } }