3
Answers

Event on button when the mouse left button is down

Romain

Romain

10y
862
1
Good morning,
 
 I contact cause I made my own user control to create a spin box. The spin box has two buttons for increase and decrease the value. I would like to create an event in order to increase or decrease the value (depend the case) when I stayed cliked, in continous, on the button. It is not the only click on the button it it is when I stay the left button down and the value continue to increase automatically.
 
Do someone know the name of the event I have to used ? I tried "PreviewMouseLeftButtonDown" but it gives the same behavior than a "Click".
 
Thank you in advance for your answer.
 
 
Answers (3)
0
Vulpes
NA 98.3k 1.5m 13y
I'm not sure what you mean by the 'reference file used' as that's just something I happen to know from my own efforts using Word or Excel interop.

However, I found a Microsoft Support link here which confirms the 'using directive' point (paragraph 7) and also contains some sample code which you may find useful:
0
Lennie Kuah
NA 27 0 13y
Hullo Vulpes,
Thank you very much for sharing information with me. Appreciate your help very much.


I will try our your suggested coding and will return to you with the result.
Can you please share with me the REFERENCE FILE USED ?


If my application is working, I will post the Overall coding here to share with other Newbies who have similar problems.


cheers,
Lennie
0
Vulpes
NA 98.3k 1.5m 13y
I'd replace this 'using' directive:
  
   using Microsoft.Office.Interop.Word;

with this one:

   using Word = Microsoft.Office.Interop.Word;

Code like this should then work (note that it's 'Word' not 'Words'):

   private Word.Application objWord;
   private Word.Document objDoc;
   private Word.Table objTable;
   private Word.Range objTableRange; 

0
Lennie Kuah
NA 27 0 13y

Hi Suthish,
I have tried your suggestion when I develop the application and it generate this error message. that's the reason why I posted my problem earlier. Thanks anyway for trying to help me.

This is the earlier Posting:
Error messages generated:
Error 1 The type name 'Application' does not exist in the type 'Microsoft.Office.Interop.Word.Words'
0
Suthish Nair
NA 31.7k 4.6m 13y
try.. Words.Application objWord = new Words.Application();