Írjunk programot, amely megjeleníti a kurzorokat a megfelelő nyomógombon kattintva, valamint a SAJÁT gombon kattintva a saját kurzort is bemutatja (egér1.cur).
A feladat megoldása
private Cursor eger1 = new Cursor("..\\..\\..\\eger1.cur");
private void AppStaring_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.AppStarting;
}
private void Arrow_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.Arrow;
}
private void Cross_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.Cross;
}
private void Default_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.Default;
}
private void IBeam_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.IBeam;
}
private void SizeAll_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.SizeAll;
}
private void SizeNESW_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.SizeNESW;
}
private void SizeNS_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.SizeNS;
}
private void SizeWE_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.SizeWE;
}
private void UpArrow_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.UpArrow;
}
private void WaitCursor_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
}
private void Help_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.Help;
}
private void Hand_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.Hand;
}
private void Sajat_Click(object sender, EventArgs e)
{
this.Cursor = eger1;
}
A program futási eredménye: