problem combobox

  • Thread starter Thread starter jonathan
  • Start date Start date
J

jonathan

Hi All!!
I'm troubled with Combo Box.(WinForm)

I'am Coding

Public p_frm As Form9

p_frm.ComboBox2.Items.Add(MonthCalendar1.SelectionStart.ToShortDateString().Replace("-",
""))

I want to select a last-Added-Item!!

In VB6.0,I guess existing NewIndex Property..

How can I solve a problem ?

Thanks in advance!!
 
Hi Jonathan,

Just use the last object entered for the SelectedItem property.

[C#
string s = MonthCalendar1.SelectionStart.ToShortDateString().Replace("-","");
p_frm.ComboBox2.Items.Add(s);
p_frm.ComboBox2.SelectedItem = s;
 
Back
Top