Search code examples
vb.netvisual-studio-2010buttoncolorscursor

Changing Button Colours


I am an Advanced Higher Computing student living in Scotland,

I need to create a Game as a project to learn about SDP and software specifications etc. etc...

I want to click [Button 1] that already has a colour property, then move the cursor to [Button 2] and when I click I want the colour of [Button 2] to change to the colour of [Button 1]

Is it possible to 'Pick Up' a colour on the VB Form and replicate it onto another button?

Any help or compromise would be greatly appreciated.

Thanks


Solution

  • Assumes two buttons on your form, Button1 and Button2:

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
      Button2.BackColor = Button1.BackColor
    End Sub