Code:
this.ClientSize = new System.Drawing.Size(842, 498);
this.Name = "Form1";
this.ResumeLayout(false);
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
SolidBrush brush = new SolidBrush(Color.Red);
SolidBrush brush1 = new SolidBrush(Color.Green);
Rectangle rect = new Rectangle(0, 0, Width, 20);
Rectangle rect1 = new Rectangle(0, 20, Width, 10);
e.Graphics.FillRectangle(brush, rect);
e.Graphics.FillRectangle(brush1, rect1);
}
this.ClientSize = new System.Drawing.Size(842, 498);
this.Name = "Form1";
this.ResumeLayout(false);
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
SolidBrush brush = new SolidBrush(Color.Red);
SolidBrush brush1 = new SolidBrush(Color.Green);
Rectangle rect = new Rectangle(0, 0, Width, 20);
Rectangle rect1 = new Rectangle(0, 20, Width, 10);
e.Graphics.FillRectangle(brush, rect);
e.Graphics.FillRectangle(brush1, rect1);
}
Cilj je, da ukoliko uradim resize prozora(recimo uvecam), ti pravougaonici automatski iscrtaju u novim dimenzijama, pri cemu ce opet zauzimati 2/3(1/3) prozora.
Pokusao sam sa Invalidate(), dobijem to sto hocu, ali ekran blinka.
Na koji nacin mogu to da uradim?