0

I am working on WPF Application. I have made small PointOfSale Type Application. When I sale the products the Bill/receipt window will open.

It is working fine when I sale product 1st time or you can say whenever I run the application first time. But whenever I am going to sale products second time the Bill/receipt window will open 2 times, selling products third time the Bill/receipt window will open 3 times and so on...

In the sale button click event

 BillWindow billwin= new BillWindow();
 billwin.Show();

In the bill window there is Print button.In Print button click event:

 this.close();

I didn't get it how it happens. Any help can appreciate.

Thank you in advance.

R76
  • 446
  • 6
  • 25
  • 1
    Post some code please... – Zak Jul 24 '12 at 10:29
  • Do you have somewhere some statics, where you keep your window instanced stored? How often is the button click event called? Do you create the BillWindow somewhere else as well in your app? So many questions ... – dowhilefor Jul 24 '12 at 10:49
  • No I only call bill window in this click handler. If I have created in other places then why it should open 1 time in first sale 2 times in second sales and so on.. If I have do so then it will open same times in each sale – R76 Jul 24 '12 at 10:56

1 Answers1

0

I just having a wild guess here. But are you registering you button click event handler multiple times?

Wolfgang Ziegler
  • 1,675
  • 11
  • 23
  • No i dont register this event multipletimes. It only calls when sale button is clicked. – R76 Jul 24 '12 at 10:57