Click here to Skip to main content
15,892,161 members

Articles by Ctznkane (Tip/Tricks: 2)

Tip/Tricks: 2

RSS Feed

Average article rating:

No articles have been posted.

Average blogs rating:

No blogs have been submitted.

Average tips rating: 4.75

Desktop Programming
Windows Forms
20 Sep 2011   Updated: 20 Sep 2011   Rating: 4.50/5    Votes: 2   Popularity: 1.35
Licence: CPOL    Views: 5,630     Bookmarked: 1   Downloaded: 0
Please Sign up or sign in to vote.
Assuming you only want a single instance of a form type, I'd suggest you add a Dictionary(Of Type, Form). ShowOrActiveForm would have a single parameter of Type and would be a subroutine.The Form object could be found based on a ContainsKey. The rest of the ShowOrActiveForm function would be...
Programming Languages
C#
13 Jun 2011   Updated: 13 Jun 2011   Rating: 5.00/5    Votes: 14   Popularity: 5.57
Licence: CPOL    Views: 13,672     Bookmarked: 5   Downloaded: 0
Please Sign up or sign in to vote.
The Array class already contains this capability with no casting required. The IndexOf method is a static one that returns the index of the value and a -1 if it doesn't exist.Here is an example:exists = Array.IndexOf(arr, "item") >= 0

Average reference rating:

No reference articles have been posted.

Average project rating:

No projects have been posted.
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.