public override void Control(Form1 f) { Point mouse = f.GetCusor(); bool click = f.GetClick(); if (mouse.X > this.x && mouse.X < this.x + this.width) { if (mouse.Y > this.y && mouse.Y < this.y + this.height) { if (click) { this.state = 2; } else if (this.state == 2) { this.action(); this.state = 1; } else { this.state = 1; } } else { this.state = 0; } } else { this.state = 0; } this.Draw(f.GetGraphics()); }
public override void Control(Form1 f) { this.rightButton.Control(f); this.leftButton.Control(f); this.title.Text = this.value.ToString(); this.title.Control(f); this.Draw(f.GetGraphics()); }
public override void Control(Form1 f) { Point mouse = f.GetCusor(); bool click = f.GetClick(); this.state = 0; if (mouse.X > this.x && mouse.X < this.x + this.width) { if (mouse.Y > this.y && mouse.Y < this.y + this.height) { if (click) { this.value = (mouse.X - this.x) / this.width; } this.state = 1; } } this.Draw(f.GetGraphics()); }
public override void Control(Form1 f) { this.Draw(f.GetGraphics()); }