Overwrite combobox to accept objects in constructor

From: Greg (gstasica_at_poczta.onet.pl)
Date: 11/25/04

  • Next message: Andrew Thompson: "Re: Overwrite combobox to accept objects in constructor"
    Date: 24 Nov 2004 23:17:09 -0800
    
    

    Hi,

    I've created ComboBox and passed in constructor vector with some
    objects. This way combobox for each object in vector invokes method
    toString (this is what user sees). How can I overwrite this method, I
    mean I'd like to write to ComboBox not result of calling toString but
    rather result of some other function in object.


  • Next message: Andrew Thompson: "Re: Overwrite combobox to accept objects in constructor"

    Relevant Pages

    • Re: Arraylist question
      ... ToString virtual method in your PERSON class to return: ... public override string ToString() ... Now you can add the instances of person directly to the combobox which will ... > public int CompareTo ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Overwrite combobox to accept objects in constructor
      ... Are you referring to JComboBox? ... This way combobox for each object in vector invokes method ... > toString. ...
      (comp.lang.java.gui)
    • Re: Adding references to objects in a comboBox
      ... possible display strings ... one item is selected in the comboBox. ... ToString() for how would I know as to what to have the overridden ToString ... > obj is a reference to your object. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Data in ComboBoxes
      ... DotNet that the item type is object and the control uses the ToString() ... method to figure out how to display it. ... public string ToString() ... > access the data of the combobox either by the items text or by its index. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: ComboBox ItemData?
      ... ToString() and use it to populate combobox. ... Finally use Combobox.SelectedItem to retrieve the selected item ... "Tim Johnson" wrote in message ...
      (microsoft.public.dotnet.framework.compactframework)