Windows Develop Bookmark and Share   
 index > Windows Forms General > numericUpDown value
 

numericUpDown value

how to check if the value in the numericUpDown control was changed by the user, either typed or copy paste using the mouse and not from my timer event?
Jassim Rahma
Jassim Rahma  Monday, September 14, 2009 8:09 PM

You can set some kind of flag whenever the value is getting changed by the timer event.
lemme know if this helps:

Declare a class variable :

static bool changedByTimer = false;

on timer event :

changedByTimer = true;

void numericUpDown1_ValueChanged(object sender, EventArgs e)
{

if(changedByTimer)


MessageBox.Show("changed by timer");
else
MessageBox.Show("Done by user");
changedByTimer=false

}


hope this helps

--------------------------------------------------------------------------------
Paras

paras kumar  Monday, September 14, 2009 8:38 PM

You can set some kind of flag whenever the value is getting changed by the timer event.
lemme know if this helps:

Declare a class variable :

static bool changedByTimer = false;

on timer event :

changedByTimer = true;

void numericUpDown1_ValueChanged(object sender, EventArgs e)
{

if(changedByTimer)


MessageBox.Show("changed by timer");
else
MessageBox.Show("Done by user");
changedByTimer=false

}


hope this helps

--------------------------------------------------------------------------------
Paras

paras kumar  Monday, September 14, 2009 8:38 PM

You can use google to search for other answers

Custom Search

More Threads

• RichTextbox image/border
• Model Question
• How to use textbox1 in a static mathod
• CheckBox Column
• How to show Culture specific data?
• Is MDI the way to go to implement a Back/Next forms stack?
• Datagridview row not set to the row I selected.
• Which is the fastest way to fill (draw) a big form with colorful dots?
• My First Events and I get an error.
• Printing Question