Hello,
I have a problem of accessing a Form element from a different class with the same name space
On the different class I’m trying to set a label of the form , by creating a instance of the form ,but the label is not being set
See here the general structure of the program

Class Form
{
Elements(label,timer etc…)
Public void set_label()
  {
   Label.text=”hello”
   }
}
Class my class
{
Form F1=new Form()
F1.set_label()
}

As explained the label doesn’t change
Any idea what I’m doing wrong?
Thanks ahead

Your form will only show the new label text after it is repainted.
It is of course painted when it is created, but after that you call your set method. Trigger a repaint by using this.Refresh(); as a last statement in your set method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.