Static Capabilities for a User-Defined Type

This is a discussion on Static Capabilities for a User-Defined Type within the C# Programming forums, part of the General Programming Boards category; Hi My project deals with a drinks machine I have one event(button click) that gets an information regarding the chosen ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    24

    Static Capabilities for a User-Defined Type

    Hi

    My project deals with a drinks machine
    I have one event(button click) that gets an information regarding the chosen drink.

    I then have another event ( another button click) , which summerizes the selection - i.e , makes the choice final.
    I need to pass on the drink entity that was chosen, to the second event.

    I thought about using the drink type as static,and then access it via any event ( meaning, Drink.drinkname or something like that) , ubt I am not familiar with this option.

    To sum things up-since I don't have global variables in c# , how do I pass information regarding an entity from one button click to another?


    Thanks for your help

    Goz
    And if you get no joy from music hall
    Remember there is always alcohol
    And If you get no joy from Gin
    Here is the abyss jump in

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    The variable you have should be known to both buttons events. So it should probably be in the class your events are defined in.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 09:18 PM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 04:06 PM
  3. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 02:22 PM
  4. Replies: 28
    Last Post: 07-17-2006, 12:35 AM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 09:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21