C# - Communicating with an external class

Discussion in 'Software' started by closet haxzor, May 13, 2008.

  1. closet haxzor

    closet haxzor Private E-2

    Alright, what I am trying to do is make a program that when you put in the day of the month, like for example 1 would be January. It tells you how many days are in the month and what the month is, I need to make an external class called clsMonths in my solution explorer because thats what this assignment wants me to do.

    So how do I communicate with this external class via my main form?

    Im thinkin that I can create arrays in this external class and grab the values to use in my form.

    Been trying to figure this out for a long time, been searching Google, and cant find much. I Couldn't figure this out on my own to save my life...

    thanks for any help.
     
  2. Kodo

    Kodo SNATCHSQUATCH

    Well, for starters the DateTime class has a method called DaysInMonth
    http://msdn.microsoft.com/en-us/library/system.datetime.daysinmonth.aspx
    SO that should save you an enormous amount of time trying to work that out ;)

    So if you have an external class, you need to add a reference to this class if it's not part of your applications solution. If it IS part of your solution, you need only to instantiate the class via the "new" keyword. I would imagine your class would be rather small given that the hard work is already done for you with the DateTime.DaysInMonth() method. :D
     
  3. closet haxzor

    closet haxzor Private E-2

    Hell yeah!! Thank you so much!! You are the shit! I really needed to get this done tonight. :D
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds