Click here to Skip to main content

Articles by jarvisa (Tip/Tricks: 5)

Tip/Tricks: 5

RSS Feed
No articles have been posted.
No blogs have been submitted.

Average tips rating: 4.00

Combo & List Boxes
General
Posted: 9 May 2011   Updated: 9 May 2011   Views: 2,109   Rating: 2.00/5    Votes: 2   Popularity: 0.60
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
ComboBox items do not have to be strings.The combobox calls ToString on each object in Items so simply add the enum values to the combobox.using System;using System.Drawing;using System.Windows.Forms;namespace Anchor_Form{ public class Form1 : Form { public...
C#
General
Posted: 30 Aug 2011   Updated: 30 Aug 2011   Views: 2,677   Rating: 5.00/5    Votes: 4   Popularity: 3.01
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
"we cannot pass a Type as a function parameter" ???Yes we can. Just look at the parameter of Enum.GetValues for example._______Generic functions are unnecessary here. Just use Object.GetType to, um, get the type.private Enum GetNextEnum(object currentlySelectedEnum){ Type...
Programming Tips
General
Posted: 2 Nov 2010   Updated: 13 Nov 2010   Views: 1,840   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
public void ControlStatus(Control control, bool isDisable){ foreach (Control c in control.Controls) if (c.HasControls()) ControlStatus(c, isDisable); else { WebControl wc = c as WebControl; if (wc != null) ...
Posted: 3 Feb 2012   Updated: 4 Feb 2012   Views: 3,634   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
string.Join(",...
Posted: 7 Feb 2012   Updated: 7 Feb 2012   Views: 2,553   Rating: 4.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Re-coded using LINQ. Stores the actual enum values in the combobox.public static void SetEnumValues(ComboBox cb){ Type t = typeof(T); if (!t.IsEnum) throw new ArgumentException("Only Enum types can be set"); cb.DisplayMember = "Key"; cb.ValueMember =...
No reference articles have been posted.

jarvisa
Software Developer (Senior) Shaw Inspection Systems Ltd
United Kingdom United Kingdom
No Biography provided


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 20 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid