PC Review


Reply
Thread Tools Rate Thread

Create buttons in another form

 
 
=?Utf-8?B?Q3liZXJkb3Q=?=
Guest
Posts: n/a
 
      23rd Sep 2004
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
 
Reply With Quote
 
 
 
 
David D Webb
Guest
Posts: n/a
 
      23rd Sep 2004
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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create radio buttons in an Access form? =?Utf-8?B?ZmlkZGxlcl83MThAeWFob28uY29t?= Microsoft Access Getting Started 4 8th Jun 2006 06:14 PM
How do I create a form in a worksheet with control option buttons. =?Utf-8?B?YW5kcmVhaA==?= Microsoft Excel New Users 2 23rd Apr 2005 01:12 AM
how to create an array of buttons on a form to reference by index. =?Utf-8?B?TWFsY29sbSBL?= Microsoft Access Form Coding 1 6th Apr 2005 04:10 PM
How to dynamically create and bind radio buttons in Windows form - VB.NET James P. Microsoft VB .NET 2 6th Dec 2004 04:15 PM
How do I create minimize and restore buttons on a user form =?Utf-8?B?TWVkaWEgQm9i?= Microsoft Excel Programming 2 29th Sep 2004 08:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:10 PM.