From: Fernando, I. <i.f...@au...> - 2005-05-15 20:10:58
|
Hi all, Firstly, I have been playing around with netron for a while now and im loving it! And further more, the code is neat and clean, online documentation is accurate. I decided that the best way to learn more was to contribute back into the effort and so I decided to extend the provided special shape ComboContolShape. It seems that I have a very trivial question ... its almost embarrassing to ask, but its something which as me stumped. To the ComboControlShape I added an option in the context menu to 'get' the selected text in the combo box. The context menu was modified by: public override MenuItem[] ShapeMenu() { MenuItem[] subitems =3D new MenuItem[]{new MenuItem("Launch Editor",new EventHandler(TheHandler))}; MenuItem[] items =3D new MenuItem[]{new MenuItem("Special menu",subitems)}; return items; } TheHandler method is as follows: private void TheHandler(object sender, EventArgs e) { string m_strFile; m_strFile =3D this.combo.SelectedIndex.ToString(); MessageBox.Show("This is:" + m_strFile + ":what we got"); } The above code works fine. As expected the message box pops up with the correct value of the selected index. So far fine. But I am after the actual string and not the index.=20 Normally when reading the string of the selected item in a combo box in a windows form I do as follows:=20 comboBox.SelectedItem.ToString(); I cannot find a similar method in the NComboBox control :( I tried different methods to try and obtain the actual string, but to no avail.=20 Should I be doing something differently? Where have I gone wrong? Thanks in advance for any help cheers |