A form is simply a class derived from Form, so just pass a reference to the
class to the function:
C#:
// Form constructor
public MyForm()
{
SomeClass.UpdateTitle((Form)this, "My Title");
}
public class SomeClass
{
public static void UpdateTitle(Form frm, string title)
{
frm.Text = title;
}
}
-Dave
"Cyberdot" <(E-Mail Removed)> wrote in message
news:2D44D574-F0A1-4E39-970D-(E-Mail Removed)...
> Hello,
> I need to add elements out of a function to several forms. Example: I have
> three forms, and every form needs a titlebar, wich i have designes as an
> image with a frew buttons. I don't want to add the titlebar in everyform,
> so
> i hoped to write a function, wich adds these few elements to the active
> form
> when called.
>
> I hope you understand my question ;o)
>
> Greetings,
> Cyberdot
|