I am developing an POS application, I am able to open the cash drawer.
but I am not able to find the event when cash drawer is closed.
Please provide me code sample/ event which fire when cash drawer get closed.
Listen to OnDrawerStateChanged event and inspect DrawerStateChangedEventArgs.DrawerOpened
value. A false
means closed. Per MSDN:
The
CashDrawerBase
class raisesOnDrawerStateChanged
events to inform the service object that the value of theCashDrawerProperties.DrawerOpened
property has been updated and the application has been notified of a drawer status change. ADrawerStateChangedEventArgs.DrawerOpened
value of true indicates the drawer status has changed to “open”; aDrawerStateChangedEventArgs.DrawerOpened
value of false indicates the drawer status has changed to “closed”. Service objects should consider implementingOnDrawerStateChanged
when they want to be notified by theCashDrawerBase
class of drawer state changes.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.