c# procedure

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
 
C

Chris Dunaway

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top