Выпадающий список с флажками

Я не думаю, что STL является Вашим ответом. Вы собираетесь нуждаться виду самокрутки решения с помощью перевыделения (). Необходимо будет сохранить указатель и или размер, или число элементов и использование, что для нахождения, где начать добавлять элементы после перевыделения ().

int *memberArray;
int arrayCount;
void GetsCalledALot(int* data1, int* data2, int count) {
    memberArray = realloc(memberArray, sizeof(int) * (arrayCount + count);
    for (int i = 0; i < count; ++i) {
        memberArray[arrayCount + i].d1 = data1[i];
        memberArray[arrayCount + i].d2 = data2[i];
    }
    arrayCount += count;
}
5
задан Iulian 29 September 2009 в 13:04
поделиться

3 ответа

The easiest way to create this effect is to use three controls — an edit, a button (to the right of the edit, with a drop down icon) and a checkboxlist as you're using now.

Position the checkboxlist under the edit so its width is the same as the edit and the button next to the edit, and make it invisible. Now, add code to the button to:

  1. Make the checklistbox visible if it is not visible and to make it not visible if it is visible (that is, flip the value of .Visible).

  2. Call code to create a "summarized" version of what was checked and not check and display it in the edit. For instance, if your "dropdown" contains color names, you might have your code create a comma-delimited list of the checked colors and display that in the edit.

You can take this a little further and put the checkboxlist into a panel container and add little buttons to the "dropdown" to execute whatever special functions might be appropriate in your application (check all, uncheck all, whatever).

2
ответ дан 14 December 2019 в 01:12
поделиться

Чтобы получить такую ​​функциональность, вам придется обратиться к владельцу.

Если в вашей форме недостаточно места, я бы посоветовал сначала посмотреть, можете ли вы провести рефакторинг графического интерфейса. чтобы было проще.

4
ответ дан 14 December 2019 в 01:12
поделиться

Я подозреваю, что ваш вопрос вполне может быть отредактирован, поскольку в настоящее время он не очень ясен. Я предполагаю, что вам нужен элемент управления раскрывающимся списком в форме, но когда список выпадает, у вас есть флажки в качестве параметров в нем? Если это так, я подозреваю, что вы, возможно, смотрите на настраиваемый набор элементов управления (элементы управления Telerik , например, позволяют создавать шаблоны для RadComboBox), но я не думаю, что есть какие-либо стандартные элементы управления, которые позволят это.

1
ответ дан 14 December 2019 в 01:12
поделиться
Другие вопросы по тегам:

Похожие вопросы: