Top.Mail.Ru
Ответы

Объясните пожалуйста новичку зачем в Main писать Application.EnableVisualStyles(); ?

Разбираюсь с C# на примере Windows Forms, запустила программу с Application.EnableVisualStyles(); все работает. Удалила Application.EnableVisualStyles(); дальше все работает, по идее должен прорисовывать элементы управления, но не понимаю как? Объясните пожалуйста, только так чтоб понятно было

По дате
По рейтингу
Аватар пользователя
11лет

На первом скрине EnableVisualStyles есть
На втором - нет

Аватар пользователя
Ученик
11лет

спасибо за ответ, все понятно

Аватар пользователя
Ученик
11лет

Всем спасибо, все понятно

Аватар пользователя
Гуру
11лет

This method enables visual styles for the application. Visual styles are the colors, fonts, and other visual elements that form an operating system theme. Controls will draw with visual styles if the control and the operating system support it. To have an effect, EnableVisualStyles() must be called before creating any controls in the application; typically, EnableVisualStyles() is the first line in the Main function. A separate manifest is not required to enable visual styles when calling EnableVisualStyles().
источник: https://msdn.microsoft.com/en-us/library/system.windows.forms.application.enablevisualstyles(v=vs.110).aspx



Видео по теме