update list of printers when new printers is added or delete/rename existing printers

Sachin 21 Reputation points
2021-10-18T09:50:40.867+00:00

i am showing all installed printers in listview of WPF using below codes

foreach (string printer in System.Drawing.Printing.PrinterSettings.InstalledPrinters)
            {
                listview.items.add(printer);
            }

i want to update its listview UI runtimes without closing the application . when new printers is added or delete/rename existing printers .

Note: we can not use timer events to call list functions in each seconds.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,676 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,276 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 81,741 Reputation points
    2021-10-18T10:34:45.883+00:00

    Handle notifications, like WM_SETTINGCHANGE, WM_DEVICECHANGE (WM_DEVMODECHANGE if renamed)

    0 comments No comments