Click here to Skip to main content
15,888,968 members
Home / Discussions / C#
   

C#

 
GeneralRe: Fill 50% of a drawing with a color Pin
r916-Feb-04 9:48
r916-Feb-04 9:48 
GeneralRe: Fill 50% of a drawing with a color Pin
Heath Stewart16-Feb-04 10:25
protectorHeath Stewart16-Feb-04 10:25 
GeneralRe: Fill 50% of a drawing with a color Pin
je_gonzalez16-Feb-04 12:54
je_gonzalez16-Feb-04 12:54 
QuestionHow to referenc functions in other code file Pin
klufy16-Feb-04 8:28
klufy16-Feb-04 8:28 
AnswerRe: How to referenc functions in other code file Pin
Colin Angus Mackay16-Feb-04 8:57
Colin Angus Mackay16-Feb-04 8:57 
GeneralRe: How to referenc functions in other code file Pin
klufy16-Feb-04 9:29
klufy16-Feb-04 9:29 
GeneralRe: How to referenc functions in other code file Pin
Colin Angus Mackay16-Feb-04 9:42
Colin Angus Mackay16-Feb-04 9:42 
GeneralRe: How to referenc functions in other code file Pin
Heath Stewart16-Feb-04 9:43
protectorHeath Stewart16-Feb-04 9:43 
This is fundamental to object-oriented programming and you really should pick up a good book about the .NET Framework (which most entry-level books present information on basic OO designs and programming) from http://www.microsoft.com/mspress[^] or something.

First of all, the files DO NOT matter, so long as their compiled into the same assembly (except in the case of Java, in which only one public class can be in a file and the classname and filename must match, and they get compiled to .class files). Second, you don't reference assembly names in code - the current assembly references other assemblies. In your case, you're using two completely different namespaces, TextLib and MyFormProject. If these are in the same assembly, they typically should share a common namespace! Notice how you keep typing using System.Something? That's not magic - you're merely telling the compiler which namespaces - which can span multiple assemblies - to look in for classes and other Types. The filename matters not.

So, you can do either of the following:
using TextLib; // The namespace
// ...
TextLib tl = new TextLib(); // The class
label.Text = tl.ReversText(textBox.Text); // That's "Reverse" with an "e", BTW
or
TextLib.TextLib tl = new TextLib.TextLib(); // The namespace.classname
label.Text = tl.ReversText(textbox.Text);
Again, you really should read a book or two on .NET programming.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: How to referenc functions in other code file Pin
klufy16-Feb-04 10:50
klufy16-Feb-04 10:50 
GeneralRe: How to referenc functions in other code file Pin
obelisk2916-Feb-04 11:23
obelisk2916-Feb-04 11:23 
GeneralRe: How to referenc functions in other code file Pin
klufy16-Feb-04 11:28
klufy16-Feb-04 11:28 
GeneralRe: How to referenc functions in other code file Pin
Heath Stewart17-Feb-04 2:58
protectorHeath Stewart17-Feb-04 2:58 
Generalcreating an app to track user input Pin
kym34516-Feb-04 8:06
kym34516-Feb-04 8:06 
GeneralRe: creating an app to track user input Pin
CWIZO16-Feb-04 8:17
CWIZO16-Feb-04 8:17 
GeneralRe: creating an app to track user input Pin
apferreira16-Feb-04 13:18
apferreira16-Feb-04 13:18 
GeneralSMTP Help Pin
mina_aziz16-Feb-04 7:00
mina_aziz16-Feb-04 7:00 
GeneralRe: SMTP Help Pin
Heath Stewart16-Feb-04 9:31
protectorHeath Stewart16-Feb-04 9:31 
GeneralASP.NET and slider controls Pin
julian_l16-Feb-04 6:54
julian_l16-Feb-04 6:54 
GeneralRe: ASP.NET and slider controls Pin
Heath Stewart16-Feb-04 9:22
protectorHeath Stewart16-Feb-04 9:22 
GeneralPrintDocument1.PrinterSettings.CanDuplex Pin
amadeonMk16-Feb-04 5:13
amadeonMk16-Feb-04 5:13 
GeneralRe: PrintDocument1.PrinterSettings.CanDuplex Pin
Heath Stewart16-Feb-04 6:54
protectorHeath Stewart16-Feb-04 6:54 
GeneralRe: PrintDocument1.PrinterSettings.CanDuplex Pin
amadeonMk16-Feb-04 21:10
amadeonMk16-Feb-04 21:10 
GeneralRe: PrintDocument1.PrinterSettings.CanDuplex Pin
Heath Stewart17-Feb-04 2:54
protectorHeath Stewart17-Feb-04 2:54 
GeneralText smoothing in a single application Pin
jremignanti16-Feb-04 4:19
jremignanti16-Feb-04 4:19 
GeneralRe: Text smoothing in a single application Pin
Heath Stewart16-Feb-04 6:43
protectorHeath Stewart16-Feb-04 6:43 

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.