Click here to Skip to main content
15,889,595 members
Home / Discussions / C#
   

C#

 
GeneralRe: Distributing a much-used function across classes Pin
spin vector25-Feb-06 6:58
spin vector25-Feb-06 6:58 
AnswerRe: Distributing a much-used function across classes Pin
Allah On Acid25-Feb-06 7:03
Allah On Acid25-Feb-06 7:03 
GeneralRe: Distributing a much-used function across classes Pin
spin vector25-Feb-06 7:20
spin vector25-Feb-06 7:20 
GeneralRe: Distributing a much-used function across classes Pin
Allah On Acid25-Feb-06 7:42
Allah On Acid25-Feb-06 7:42 
GeneralRe: Distributing a much-used function across classes Pin
spin vector25-Feb-06 8:17
spin vector25-Feb-06 8:17 
GeneralRe: Distributing a much-used function across classes Pin
Allah On Acid25-Feb-06 8:25
Allah On Acid25-Feb-06 8:25 
GeneralRe: Distributing a much-used function across classes Pin
spin vector25-Feb-06 8:31
spin vector25-Feb-06 8:31 
AnswerRe: Distributing a much-used function across classes Pin
mrsnipey1-Mar-06 18:23
mrsnipey1-Mar-06 18:23 
Have you tried declaring the function you want to be able to use everywhere
as a public static.

i.e.

public static void doThisEveryWhere()
{
...
}

You can now call this function from any of your other classes.

I usually have a common functions class called common.cs and I define all my common functions in it. And as it is static you don't have to create a common object to reference the function.

You would just type:
common.doThisEveryWhere();

Hope this helps.
Questioncreate c# window form installer Pin
batmanAgen25-Feb-06 5:28
batmanAgen25-Feb-06 5:28 
QuestionDeployment in VS2005. Pin
ranzask25-Feb-06 2:49
ranzask25-Feb-06 2:49 
QuestionSecond Email about How to Print in Windows Forms ?? Pin
Abubakarsb25-Feb-06 1:36
Abubakarsb25-Feb-06 1:36 
AnswerRe: Second Email about How to Print in Windows Forms ?? Pin
emran83425-Feb-06 1:56
emran83425-Feb-06 1:56 
QuestionWindow resizing Pin
XeoN-Kc25-Feb-06 1:22
XeoN-Kc25-Feb-06 1:22 
AnswerRe: Window resizing Pin
User 665825-Feb-06 2:30
User 665825-Feb-06 2:30 
GeneralRe: Window resizing Pin
XeoN-Kc25-Feb-06 2:42
XeoN-Kc25-Feb-06 2:42 
GeneralRe: Window resizing Pin
User 665825-Feb-06 3:25
User 665825-Feb-06 3:25 
AnswerRe: Window resizing Pin
Robert Rohde26-Feb-06 6:35
Robert Rohde26-Feb-06 6:35 
GeneralRe: Window resizing Pin
XeoN-Kc28-Feb-06 1:37
XeoN-Kc28-Feb-06 1:37 
Questionclass Image Pin
videhr24-Feb-06 23:52
videhr24-Feb-06 23:52 
AnswerRe: class Image Pin
James Gupta25-Feb-06 0:12
professionalJames Gupta25-Feb-06 0:12 
GeneralRe: class Image Pin
videhr25-Feb-06 4:58
videhr25-Feb-06 4:58 
GeneralRe: class Image Pin
User 665825-Feb-06 5:13
User 665825-Feb-06 5:13 
GeneralRe: class Image Pin
videhr25-Feb-06 5:30
videhr25-Feb-06 5:30 
GeneralRe: class Image Pin
User 665825-Feb-06 5:33
User 665825-Feb-06 5:33 
GeneralRe: class Image Pin
videhr25-Feb-06 5:57
videhr25-Feb-06 5:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.