Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
cBall demBall = new cBall(50, 265);
private void onKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
//MessageBox.Show(e.KeyValue.ToString());
switch(e.KeyValue)
{
case 32: demBall.Move();
}
}
public void rePaint()
{
Graphics g = new Graphics();
Brush myBrush = new SolidBrush(foreColor);
g.FillEllipse(myBrush, Convert.ToInt32(actX), Convert.ToInt32(actY), width, width);
}
public class cBall
{
private Form parent;
public cBall(Form parent, ..)
{
this.parent = parent;
}
private void RefreshParent()
{
if (parent != null)
parent.Refresh();
}
}
public class cBall
{
private Form parent;
public Form Parent
{
get { return parent; }
set { Parent = value; }
}
private void RefreshParent()
{
if (parent != null)
parent.Refresh();
}
}
public void rePaint()
{
Graphics g = Graphics.FromHwnd(parent.Handle);
Brush myBrush = new SolidBrush(foreColor);
g.FillEllipse(myBrush, Convert.ToInt32(actX), Convert.ToInt32(actY), width, width);
}
public void rePaint(Graphics g)
{
Brush myBrush = new SolidBrush(foreColor);
g.FillEllipse(myBrush, Convert.ToInt32(actX), Convert.ToInt32(actY), width, width);
}
Original geschrieben von sra
Muss ich also den unschönen Weg gehen, und im Form1 eine Eigenschaft Graphics g machen, diese im onPaint Event initialisieren, im Timer das Graphics Objekt der Move Methode übergeben, welche es der rePaint Methode weiterletiet, welche das Objekt dann braucht?
Das müsste doch "schöner" zu lösen sein