Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27212

Label back colour changing problem

$
0
0
Hello

I want to change a labels back color on form1 via a button on form 2, both of which are open.

The code i tried for this is:

Code:

Form1.lbl11.BackColor = Color.Green
But this dosent work, so i assumed its not passing it to the other form correctly so i tried a class on form 1

Code:

Public Sub Changegreen()

        lbl11.BackColor = Color.Green
       
    End Sub

Calling it on form2 by

Code:

Call form1.Changegreen()
But this dosent change the color either, ive put a message box in the class to popup which it does so it is running just the color not changing. The only way it will change color is by a click/double click on another item on form1

What am i missing?

Viewing all articles
Browse latest Browse all 27212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>