Results 1 to 3 of 3

Thread: Constructors

Hybrid View

  1. #1
    Member
    Join Date
    Aug 08
    Posts
    59

    Constructors

    Stupid question I am sure but I have no idea how to do it.

    Lets say I have a window (wpf) called wndWindow.

    Code:
    wndWindow tWindow = new wndWindow();
    Now I'd like to create a constructor for wndWindow which will accept an argument. Essentially, I want to be able to do something like:

    Code:
    wndWindow tWindow = new wndWindow(options.thisoption);
    Previously I've just used numbers and I just remembered which number corresponds to what but I'm reusing this window heaps and keep forgetting the numbers as there are about 12 of them.

    So I'd type option. and then intellisense will show the list of options. These options might be Option1, Option2, Option3, Optiona, Optionb.

    It's hard to google for something when I don't actually know what this is called, lol.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,653

    Re: Constructors

    It's an Enum... here... http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx

    Enjoy!

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  3. #3
    Member
    Join Date
    Aug 08
    Posts
    59

    Re: Constructors

    Thanks, got it all going how I wanted it now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •