我用 DrawString 创建了一个滚动文本。它可以工作,但文本仍保留在表单元素下。我希望文本通过。编码:
int x = 0;
string texto = "prova prova";
int tam = 15;
private void timer_Tick_1(object sender, EventArgs e)
{
Graphics gra = this.CreateGraphics();
gra.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
gra.DrawString(texto, new Font("Times New Roman", tam), new SolidBrush(Color.CornflowerBlue),x, 70);
gra.Dispose();
x += 6;
if (x >= this.Width)
x = texto.Length * tam * -1;
}