Error please help
-
Hai, Please take a look my code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace Combo
{public class Combo //:IDisposable { private System.Windows.Forms.ComboBox li = new System.Windows.Forms.ComboBox(); //object public event EventHandler SelectedIndexChanged; private object\[\] eventObject; public void Addselect(Control FormName, string name, int top, int left, int width, int height, string Text) { li.Top = top; li.Left = left; li.Width = width; li.Height = height; li.Name = name; li.FlatStyle = FlatStyle.Flat; li.Text = Text; li.IntegralHeight = false; li.MaxDropDownItems = 5; li.DropDownStyle = ComboBoxStyle.DropDown; li.Size = new System.Drawing.Size(136, 81); li.BackColor = System.Drawing.Color.DarkGray; FormName.Controls.Add(li); eventObject = new object\[\] { this, "SelectedIndexChanged" }; li.SelectedIndexChanged += new EventHandler(li\_SelectedIndexChanged); } private void li\_SelectedIndexChanged(object sender, EventArgs e) { if (SelectedIndexChanged != null) //You must test this. { SelectedIndexChanged(eventObject, null); } } public bool Enabled { get { return li.Enabled; } set { li.Enabled = value; } } public bool Visible { get { return li.Visible; } set { li.Visible = value; } } public void Addtocombobox(string \[\] arguments ) { li.Items.AddRange(arguments); } ** public int sindex() { int index; index = li.SelectedIndex; return index; }**
}
}The problem is
public int sindex()
{int index; index = li.SelectedIndex; return index; }
when i try to return the selected index of combobox i got error here please hep me to do fix this error This is my error please take a look this
Error 1 Since 'Combo.Comb
-
Hai, Please take a look my code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace Combo
{public class Combo //:IDisposable { private System.Windows.Forms.ComboBox li = new System.Windows.Forms.ComboBox(); //object public event EventHandler SelectedIndexChanged; private object\[\] eventObject; public void Addselect(Control FormName, string name, int top, int left, int width, int height, string Text) { li.Top = top; li.Left = left; li.Width = width; li.Height = height; li.Name = name; li.FlatStyle = FlatStyle.Flat; li.Text = Text; li.IntegralHeight = false; li.MaxDropDownItems = 5; li.DropDownStyle = ComboBoxStyle.DropDown; li.Size = new System.Drawing.Size(136, 81); li.BackColor = System.Drawing.Color.DarkGray; FormName.Controls.Add(li); eventObject = new object\[\] { this, "SelectedIndexChanged" }; li.SelectedIndexChanged += new EventHandler(li\_SelectedIndexChanged); } private void li\_SelectedIndexChanged(object sender, EventArgs e) { if (SelectedIndexChanged != null) //You must test this. { SelectedIndexChanged(eventObject, null); } } public bool Enabled { get { return li.Enabled; } set { li.Enabled = value; } } public bool Visible { get { return li.Visible; } set { li.Visible = value; } } public void Addtocombobox(string \[\] arguments ) { li.Items.AddRange(arguments); } ** public int sindex() { int index; index = li.SelectedIndex; return index; }**
}
}The problem is
public int sindex()
{int index; index = li.SelectedIndex; return index; }
when i try to return the selected index of combobox i got error here please hep me to do fix this error This is my error please take a look this
Error 1 Since 'Combo.Comb
No, the problem is not in sindex(). It is in F:\SelectboxLibrary\SelectboxLibrary\Class1.cs, line 65. - What's the code there? - How is Combo.Combo linked with that project? I.e. is an older version of Combo.Combo used by Class1 - a version where sindex() is
public void sindex()
? -
No, the problem is not in sindex(). It is in F:\SelectboxLibrary\SelectboxLibrary\Class1.cs, line 65. - What's the code there? - How is Combo.Combo linked with that project? I.e. is an older version of Combo.Combo used by Class1 - a version where sindex() is
public void sindex()
?Thankyou for your replay iam trying to create a library of combobox the code shown above is the class1.cs file. of-course there are no other file in my project. Thank you Arunkumar.T
-
Thankyou for your replay iam trying to create a library of combobox the code shown above is the class1.cs file. of-course there are no other file in my project. Thank you Arunkumar.T
Where does this error message come from, compiler or linker? And which compiler are you using?
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman