Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I have to forms (2 diferent clases) and one object, I need that object in the bougth forms. How do I do that?

 

If I declare that object in the first form, how do I see it in the second?

 

Thanks.

Edited by guest31ro
Posted

MODULE

 

you can put your object declaration in module !

 

Public myObject as New Something()

Some people are wise and some are other-wise.
Posted

for exapmle I have something like this:

 

public class Form1:form

{

......

static void Main()

{

Form1 FormN = new Form1();

Application.Run(FormN);

}

.....

private void top()

{

FormN.Size = new Size(30;56);

}

}

 

I would like to use the FormN in a new form but if I declare it outside the main, I can not see it in main, and if I declare it in main I con not see it outside the main.

What should I do?

Posted (edited)
you could overload constructor of your "other Forms" and then you can pass FormN as parametar!! Edited by sizer
Some people are wise and some are other-wise.
Posted

I have to forms (cass-es)

Form A and Form B

 

The problem is that I nedd to modify something from Form B in Form A, and olso I need to modify something form Form A in Form B.

 

What should I do? Any sugestion?

 

Thanks.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...