i do an small windows application using C# that use picture, am create an ZoomIn function that will zoom in to the picture,what i need is how can i hold mouse left click to call zoom in fucntion, only hold the left click mouse at the zoom in button
i need the event
please help

mouse down event
j_ruez
if you used the designer, just double click the zoom in button that it will create an event handler for the Click event in the code. Then just call your zoom in function there.
If you didn't use the designer, you'll need to attach the event handler yourself:
buttonZoomIn.Click += new System.EventHandler(buttonZoomIn_Click);
private void buttonZoomIn_Click(object sender, EventArgs e)
{
// call your zoom in function or insert the code to zoom in here
}
stir
use a timer then. In the mouse down event start the timer:
timer.Enabled = true;
m_buttonPressed = true;
then in the timer's tick function do the zoom:
private void timer_Tick(object sender, EventArgs e)
{
// set the interval
timer.Interval = m_repDelay;
if(m_buttonPressed)
{
// zoom
}
}
then in the mouse up event just stop the timer:
if(this.Enabled == false)
return;
timer.Enabled = false;
m_buttonPressed = false;
edudog48
hi,
Is your problem solved
Thank you,
Bhanu.
exo_duz
dear,
that will not help, ido that but not helpful, since it will call the zoom in function for one time,
ineed to hold the left mouse click in the button to always zoom in.
when am leave the left mouse click stop calling zoom in,
please advise