Hallo, ich bins mal wieder.
Ich habe mir das Buch "Einstieg in Visual C# 2010" von Thomas Theis geholt. Ich bin grade auf S. 57 bei der Übung zum Panelzeitgeber.
Ich habe 1 Button ("Start"), 1 Timer und 4 Panels erstellt. Jedes einzelne Panal sollte sich nach untenlinks, obenlinks... bewegen wenn man auf "Start" klickt. Aber beim Debuggen steht ein Fehler bei "new Point", das steht bei allen 4 new Points! Wieso? Was muss ich machen? Könnt ihr mir bitte helfen?
Code:
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void cmdStart_Click(object sender, EventArgs e)
{
timer.Enabled = true;
}
private void timer_Tick(object sender, EventArgs e)
{
pnlLinks1 = new Point(
pnlLinks1.Location.X - 5, pnlLinks1.Location.Y - 5);
pnlLinks2 = new Point(
pnlLinks2.Location.X - 5, pnlLinks2.Location.Y + 5);
pnlRechts1 = new Point(
pnlRechts1.Location.X + 5, pnlRechts1.Location.Y - 5);
pnlRechts2 = new Point(
pnlRechts2.Location.X + 5, pnlRechts2.Location.Y + 5);
}
}
}
FEHLER:
Fehler 3 Eine implizite Konvertierung vom Typ "System.Drawing.Point" in "System.Windows.Forms.Panel" ist nicht möglich. C:\Users\Cillari\Documents\Visual Studio 2010\Projects\Panelbewegungen\Panelbewegungen\Form1.cs Z.33 S.26 Projekt: Panelbewegungen