Click here to Skip to main content
15,899,825 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# UserControl in a Win32 Window Pin
Alomgir Miah22-Jul-05 7:39
Alomgir Miah22-Jul-05 7:39 
GeneralProblems Reading Cell Values from Excel Spreadsheets Using OleDB Pin
fmarcos22-Jul-05 6:55
fmarcos22-Jul-05 6:55 
GeneralRe: Problems Reading Cell Values from Excel Spreadsheets Using OleDB Pin
fmarcos22-Jul-05 7:18
fmarcos22-Jul-05 7:18 
Generalwriting to ms word document bookmarks Pin
xrado22-Jul-05 6:33
xrado22-Jul-05 6:33 
GeneralRe: writing to ms word document bookmarks Pin
Alomgir Miah22-Jul-05 7:50
Alomgir Miah22-Jul-05 7:50 
GeneralRe: writing to ms word document bookmarks Pin
sameerhanda25-Jul-05 17:15
sameerhanda25-Jul-05 17:15 
GeneralCombobox.DisplayName and Interfaces Pin
Miszou22-Jul-05 6:21
Miszou22-Jul-05 6:21 
GeneralRe: Combobox.DisplayName and Interfaces Pin
malharone22-Jul-05 6:41
malharone22-Jul-05 6:41 
Make sure to override "ToString()" method of the object you're adding to the dropdown. The dropdown will display the value returned by ToString and thus you dont need to set the databinding.
So ...
<br />
public class User<br />
{<br />
  string _fname;<br />
  string _lname;<br />
  public User(string FName, string LName)<br />
  {<br />
    _fname = FName;<br />
    _lname = LName;<br />
  }<br />
  public override string ToString()<br />
  {<br />
    return string.Format("{0}, {1}", _lname, _fname);<br />
  }<br />
}<br />
<br />
//--- your combo init method in form<br />
private void form2_Load(object s, System.EventArgs e)<br />
{<br />
  User[] arUsers = new User[2];<br />
  arUsers[0] = new User("John","Smith");<br />
  arUsers[1] = new User("Jane","Smith");<br />
  this.comboBox1.Items.AddRange(arUsers);;<br />
}<br />


hope this helps.

- Malhar
GeneralRe: Combobox.DisplayName and Interfaces Pin
Alomgir Miah22-Jul-05 7:42
Alomgir Miah22-Jul-05 7:42 
GeneralRe: Combobox.DisplayName and Interfaces Pin
leppie22-Jul-05 11:27
leppie22-Jul-05 11:27 
GeneralRe: Combobox.DisplayName and Interfaces Pin
Miszou22-Jul-05 17:06
Miszou22-Jul-05 17:06 
QuestionApplication Manifest Bug C#? Pin
rkap22-Jul-05 5:49
rkap22-Jul-05 5:49 
GeneralExplorer in C# Pin
Fco. Javier Marin22-Jul-05 5:41
Fco. Javier Marin22-Jul-05 5:41 
GeneralDrawing a line Pin
zaboboa22-Jul-05 5:41
zaboboa22-Jul-05 5:41 
GeneralRe: Drawing a line Pin
K-Nine22-Jul-05 6:13
K-Nine22-Jul-05 6:13 
GeneralRe: Drawing a line Pin
zaboboa22-Jul-05 6:23
zaboboa22-Jul-05 6:23 
GeneralAdd forms to a container Pin
David_cole22-Jul-05 5:36
David_cole22-Jul-05 5:36 
GeneralRe: Add forms to a container Pin
Dave Kreskowiak22-Jul-05 5:50
mveDave Kreskowiak22-Jul-05 5:50 
GeneralRe: Add forms to a container Pin
David_cole22-Jul-05 5:59
David_cole22-Jul-05 5:59 
GeneralRemoting disconnections Pin
Judah Gabriel Himango22-Jul-05 5:26
sponsorJudah Gabriel Himango22-Jul-05 5:26 
GeneralRe: Remoting disconnections Pin
mav.northwind23-Jul-05 0:26
mav.northwind23-Jul-05 0:26 
GeneralReport Generator Pin
Akbar Qofrani22-Jul-05 5:16
Akbar Qofrani22-Jul-05 5:16 
GeneralRe: Report Generator Pin
Anonymous24-Jul-05 21:00
Anonymous24-Jul-05 21:00 
GeneralRe: Report Generator Pin
Anonymous25-Jul-05 23:08
Anonymous25-Jul-05 23:08 
GeneralAutosizing columns in DataGrid Pin
Tom Wright22-Jul-05 4:59
Tom Wright22-Jul-05 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.