Кнопка Winforms: Видимый = ложь подразумевают, Включил = ложь?

Полезно поставить имена функций в новой строке, таким образом, Вы можете grep как

grep -R '^fun_name' .

для них. Я видел, что стиль использовал для загрузки проектов GNU и как он:

static void
fun_name (int a, int b) {
    /* ... */
}
6
задан Mariusz Jamro 2 June 2016 в 12:43
поделиться

3 ответа

If the control is not visible, it is effectively disabled. Clicking in the area where it would appear (or rolling in and out of that area) were it visible will not cause an event to fire.

EDIT: To clarify, based on other responses and comments, the button is not disabled and underlying event functionality is still available programmatically, but the button will not be physically available/visible on the form and the user will not be able to interact with it in any way (unless you, as the programmer, provide another method programmatically).

5
ответ дан 16 December 2019 в 21:43
поделиться

Setting Visible to false does not change the Enabled property. However, setting the property to false does make the control effectively not even there. If you click in the empty space left by an invisible the button, the button's click event won't fire.

1
ответ дан 16 December 2019 в 21:43
поделиться

I don't think it implies it is disabled. It just means the control is not visible on the form hence there is no way to perform the action on it. If you set the visible property to false and then invoked the Click event through code it would process. However, if you set the Enabled property to False I would imagine it wouldn't

1
ответ дан 16 December 2019 в 21:43
поделиться
Другие вопросы по тегам:

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