Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

Wolfgang Loder

@Wolfgang Loder
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Overriding ToString
    W Wolfgang Loder

    Coming back to the original problem, you can also fill a listbox or combobox by setting the datasource to any object that implements the interface IList. I had the problem,that I wanted the ValueMember property differently set to the DisplayMember. With the collections Add() method this is not possible. So I defined a simple class: internal class clsName { private string _longname; private int _uid; public string LongName {get {return _longname;} set {_longname = value;}} public int UID {get {return _uid;} set {_uid = value;}} public clsName (string lname, int uid) { _longname = lname; _uid = uid; } } and filled the combobox with an arraylist (the parameters come from a xml file): [...] _arrNames.Add(new clsName(nav2.Value,System.Convert.ToInt32(iterator.Current.GetAttribute("UID",nav.NamespaceURI)))); [...] The combobox datasource can then be set to the arraylist and the members to the appropriate custom class properties. [...] cb.DataSource = _arrNames; cb.DisplayMember = "LongName"; cb.ValueMember = "UID"; [...] That's all and the list is filled with the strings plus the value is set to what I need in the combobox event handler later in the application. Wolfgang

    C#

  • friend classes?
    W Wolfgang Loder

    Alexandru, a similar construct to friend is the internal keyword, which allows access from within the same assembly, but not from outside. Wolfgang

    C# c++ com question

  • Arrays
    W Wolfgang Loder

    Bo, I can see two mistakes: (1) referring to '7.5.10.2 Array creation expressions' in the C# online reference you cannot instantiate the sub-arrays, because the initial value of the first array is null. But in any case this would be an array of new byte [count] []. You try to create a subarray, where no array is created and initiated: new byte [][count] <- this can never work, because the compiler doesn't know how many sub-arrays (i.e. memory) must be initiated. (2) don't cast to uint, use System.Convert.ToUInt32. Hope this makes your year :cool: Wolfgang

    C# data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups