Click here to Skip to main content
15,887,394 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to access the outlook mail from C#? Pin
Abhijit Jana28-Sep-09 20:41
professionalAbhijit Jana28-Sep-09 20:41 
Questionincrement [modified] Pin
_Q12_28-Sep-09 11:44
_Q12_28-Sep-09 11:44 
AnswerRe: increment Pin
Henry Minute28-Sep-09 12:31
Henry Minute28-Sep-09 12:31 
GeneralRe: increment [modified] Pin
_Q12_28-Sep-09 22:04
_Q12_28-Sep-09 22:04 
GeneralRe: increment Pin
Henry Minute29-Sep-09 0:00
Henry Minute29-Sep-09 0:00 
GeneralRe: increment Pin
DaveyM6929-Sep-09 0:53
professionalDaveyM6929-Sep-09 0:53 
GeneralRe: increment Pin
Henry Minute29-Sep-09 1:25
Henry Minute29-Sep-09 1:25 
AnswerRe: increment Pin
Luc Pattyn29-Sep-09 1:42
sitebuilderLuc Pattyn29-Sep-09 1:42 
Hi,

this seems to work well for clicks, arrow up/downs, and pastes.
The assumptions are:
- value, min and max are integer numbers within the int range
- the initial value is below 10

private void nud_ValueChanged(object sender, EventArgs e) {
	decimal newValue=nud.Value;
	if (newValue>10) {
		bool incrementing=nud.Tag==null?true:nud.Value>(decimal)nud.Tag;
		newValue=((int)newValue/10)*10;	// round down to multiple of 10
		if (incrementing) newValue+=10;
	}
	nud.Tag=newValue;
	nud.Value=newValue;  // fires on change only!
}


The state (old value) isn't kept in Increment (which I don't touch), it is in Tag.

Bonus: works fine for other increment values, although it may surprise around 10 (e.g. 0,3,6,9,20)

Smile | :)

Luc Pattyn

Local announcement (Antwerp region): Lange Wapper? Neen!


QuestionLinking 3 tables to 1 form [modified] Pin
Daniel.J.A28-Sep-09 10:53
Daniel.J.A28-Sep-09 10:53 
AnswerRe: Linking 3 tables to 1 form Pin
Henry Minute28-Sep-09 12:03
Henry Minute28-Sep-09 12:03 
GeneralRe: Linking 3 tables to 1 form Pin
Daniel.J.A28-Sep-09 12:14
Daniel.J.A28-Sep-09 12:14 
GeneralRe: Linking 3 tables to 1 form Pin
Henry Minute28-Sep-09 12:25
Henry Minute28-Sep-09 12:25 
Questionhow to mark some rows in datagrid ? Pin
E_Gold28-Sep-09 9:37
E_Gold28-Sep-09 9:37 
AnswerRe: how to mark some rows in datagrid ? Pin
Henry Minute28-Sep-09 10:17
Henry Minute28-Sep-09 10:17 
QuestionDoes anyone know of an recommending tool... Pin
Paw Jershauge28-Sep-09 8:31
Paw Jershauge28-Sep-09 8:31 
AnswerRe: Does anyone know of an recommending tool... Pin
Henry Minute28-Sep-09 9:20
Henry Minute28-Sep-09 9:20 
GeneralRe: Does anyone know of an recommending tool... Pin
Paw Jershauge28-Sep-09 22:01
Paw Jershauge28-Sep-09 22:01 
QuestionMarshaling between managed and unmanaged [modified] Pin
akhanal28-Sep-09 6:47
akhanal28-Sep-09 6:47 
AnswerRe: Marshaling between managed and unmanaged Pin
Luc Pattyn28-Sep-09 7:45
sitebuilderLuc Pattyn28-Sep-09 7:45 
GeneralRe: Marshaling between managed and unmanaged Pin
akhanal28-Sep-09 8:28
akhanal28-Sep-09 8:28 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn28-Sep-09 8:48
sitebuilderLuc Pattyn28-Sep-09 8:48 
GeneralRe: Marshaling between managed and unmanaged Pin
Richard MacCutchan28-Sep-09 9:16
mveRichard MacCutchan28-Sep-09 9:16 
GeneralRe: Marshaling between managed and unmanaged Pin
Luc Pattyn28-Sep-09 9:32
sitebuilderLuc Pattyn28-Sep-09 9:32 
GeneralRe: Marshaling between managed and unmanaged [modified] Pin
akhanal28-Sep-09 9:28
akhanal28-Sep-09 9:28 
GeneralRe: Marshaling between managed and unmanaged [modified] Pin
Luc Pattyn28-Sep-09 9:43
sitebuilderLuc Pattyn28-Sep-09 9:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.