Hi..
Can I use a gauge as a turnbutton (I dont know how i can call it). I mean: Wenn I click over the gauge, the line in it has to follow the mouse, so the value of the gauege has to change.
Is sth like that possible?
Thansk..
turn Gauge
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MU,
You can do something like this:
BTW: You can call it a knob .
You can do something like this:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
gauges1.Value = 50;
}
private bool moveGauge = false;
private void tChart1_MouseDown(object sender, MouseEventArgs e)
{
moveGauge = true;
}
private void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if (moveGauge)
{
int tmpL = gauges1.CalcXPos(0) - gauges1.XRadius;
int tmpW = (gauges1.CalcXPos(0) + gauges1.XRadius) - tmpL;
double val = ((double)(e.X - tmpL) / (double)tmpW) * gauges1.Maximum;
gauges1.Value = val;
}
}
private void tChart1_MouseUp(object sender, MouseEventArgs e)
{
moveGauge = false;
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |