Tony Allan

Tony Allan

  • NA
  • 71
  • 9.7k

Passing colour of button from Button Click event to Function

Jan 29 2017 3:36 PM

In this code I have a grid with a second grid in it (Grid1).

When an object is added to Grid1 a corresponding button is created in the stack panel below.

Which object is displayed in Grid1 is chosen by clicking the appropriate button.

All good BUT I can not work out how to set the colour of the button in the Button Click Event (btnAddPO_Click or btnAddGR_Click) at present I set the colour to Yellow in the function but this means that all buttons in the stack panel are all the same colour. I wish to set the colour in the btnAddPO_Click or btnAddGR_Click events then past it to the function.

Any Ideas ?

I have attached the full code.

 

Thank you Tony.


Attachment: Buttton_Colour.zip

Answers (2)