What is UserPreferenceChangedEventHandler in winform applications for C #?

I found that some of my winform controls, such as DataGridView and ToolStrips, are called UserPreferenceChangedEventHandlers. I have no idea what control settings these links will generate and why such links keep my control in memory. How to remove such links from this event? Thanks.

+3
source share
1 answer

This is the delegate type for the SystemEvents.UserPreferenceChanged event. This event fires when Windows sends the WM_SETTINGCHANGE message. This usually happens when the user uses the control panel applet and changes the system settings.

, DataGridView, DateTimePicker, MonthCalendar, ProgressBar, PropertyGrid, RichTextBox, ToolStrip, NumericUpDown. , .

SystemEvents.UserPreferenceChanged - . , . , , OnHandleDestroyed(), Dispose().

, . , Controls Dispose(). Dispose() , . , . Controls.

Dispose() , ShowDialog(), . using - .


UserPreferenceChanged , , . , ( Win + L). , , SystemEvents , , , , .

, , , , SystemEvents , . . , .

+7

Source: https://habr.com/ru/post/1712764/


All Articles