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

Sachin 21 Reputation points

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

foreach (string printer in System.Drawing.Printing.PrinterSettings.InstalledPrinters)

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,290 questions
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.
7,614 questions
No comments
{count} votes

1 answer

Sort by: Oldest
  1. Castorix31 69,176 Reputation points

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