c# procedure

  • Thread starter Thread starter Jassim Rahma
  • Start date Start date
J

Jassim Rahma

Hi,

I have a procedure in Form_A which changes the form text and the label
caption on the same form and display a message. The procedure is:

public void yahaa()
{
this.Text = "TEST";
lblName.Text = "TEST";
MessageBox.Show("Yahaa!!", "STOP!!", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}


I am calling this procedure from Form_B

but I am just getting the message displayed without changing the form
text and label caption


first, I want to ask wehther what i'm doing is correct because I want to
add some database action in the same proceure.

then, if it is correct.. why the form text and label caption are not
changed..


Many Thanks
Jassim Rahma
 
How are you calling it from Form_B? Did you pass a reference to Form_A
into Form_B? It sounds like you may have created a new instance of
Form_A inside Form_B and that is the one you are changing instead of
your existing one.

Can you show some code where you call the yahaa procedure?
 
Back
Top