Hello all, here I am begging for help again.
Code:
Code:
//////////////////////////////////
using System;
using System.Windows.Forms;
using System.Drawing;
//////////////////////////////////
//////////////////////////////////
class App
{
public static void Main()
{
Application.Run(new Start());
}
}
//////////////////////////////////
//////////////////////////////////
class Start:Form
{
TextBox search;
Button newclass;
Button searchb;
ComboBox clist;
Label searchlabel;
Label clistlabel;
//Button classdet;
public Start()
{
search = new TextBox();
search.Location = new Point(8, 96);
search.Size = new Size(128, 30);
search.Anchor = AnchorStyles.Top|AnchorStyles.Bottom|AnchorStyles.Left|AnchorStyles.Right;
newclass = new Button();
newclass.Location = new Point(298, 248);
newclass.Size = new Size(128, 56);
newclass.Text = "New class!";
newclass.Click += new System.EventHandler(addclass_OnClick());
searchb = new Button();
searchb.Location = new Point(150, 96);
searchb.Size = new Size(56, 56);
searchb.Text = "Search";
searchb.Click += new System.EventHandler(searchclass_OnClick());
clist = new ComboBox();
clist.Location = new Point(8,248);
clist.Size = new Size(280,21);
clist.DropDownWidth = 280;
clist.Items.AddRange( new object[] {"class list"});
clist.TabIndex = 7;
clist.Anchor = AnchorStyles.Top|AnchorStyles.Bottom|AnchorStyles.Left|AnchorStyles.Right;
searchlabel = new Label();
searchlabel.Location = new Point(8,80);
searchlabel.Size = new Size(144, 23);
searchlabel.Text = "Search for class:";
clistlabel = new Label();
clistlabel.Location = new Point(8, 228);
clistlabel.Size = new Size(144, 23);
clistlabel.Text = "Course list:";
ClientSize = new Size(350, 325);
Controls.AddRange(new Control[]
{
search, newclass, searchb, clist, searchlabel, clistlabel
});
Text = "RR's Gradekeeper v 2.0.0";
}
public void addclass_OnClick(object sender, EventArgs e)
{
try
{
clist.Items.Add(search.Text);
}
catch
{
MessageBox.Show("Add class failed");
}
}
public void searchclass_OnClick(object sender, EventArgs e)
{
try
{
int index = clist.FindString(search.Text);
clist.SelectedIndex = index;
}
catch
{
MessageBox.Show("Search failed");
}
}
}
Error:
Code:
GK2\Gradekeeper2.cs(44,45): error CS1501: No overload for method
'addclass_OnClick' takes '0' arguments
GK2\Gradekeeper2.cs(78,14): (Location of symbol related to previous error)
GK2\Gradekeeper2.cs(50,44): error CS1501: No overload for method
'searchclass_OnClick' takes '0' arguments
GK2\Gradekeeper2.cs(90,14): (Location of symbol related to previous error)
Things I've tried:
1) Making both functions with different names
2) Making both functions private members
3) Making both functions public members
4) changing Object to object
5) changing EventArgs to System.EventArgs
6) Vice versa for #5
I'm out of ideas on what it could be. If someone could point me in the right direction I'd be very very thankful.