| Author |  Topic  |  | 
              
                | ma.montesiNovice
 
  
 
                6 Posts | 
                    
                      |  Posted - 29 Apr 2015 :  07:33:54     
 |  
                      | Hi, I have a ctlUniTextBoxXP wrapped in a custom usercontrol. Everything works fine if I press keys on the keyboard.
 When an application tries to write text in my control using the SendKeys statement (I'm sure the usercontrol is focused) the keyboard events loose the correct shift argument.
 For example if I press Shift+A on the keyboard the code below output is:
 
 keydown 16 Shift = 1
 keydown 65 Shift = 1
 keyup 65 Shift = 1
 keyup 16 Shift = 0
 
 If I use SendKeys "+a" the output is:
 
 keydown 16 Shift = 0
 keydown 65 Shift = 0
 keyup 65 Shift = 0
 keyup 16 Shift = 0
 
 Can this behavior be fixed?
 Thanks in advance, Marco
 
 Private Sub MyRichTextBox1_KeyDown(KeyCode As Integer, Shift As Integer)
 Debug.Print "keydown " & KeyCode & " Shift = " & Shift
 End Sub
 
 Private Sub MyRichTextBox1_KeyUp(KeyCode As Integer, Shift As Integer)
 Debug.Print "keyup " & KeyCode & " Shift = " & Shift
 End Sub
 |  | 
              
                | s.davSite Admin
 
      
 
                Italy3364 Posts
 | 
                    
                      |  Posted - 03 May 2015 :  23:09:15       
 |  
                      | Marco, send me the sample project and I'll check |  
                      | Regards, Davide
 |  
                      |  |  | 
              
                | ma.montesiNovice
 
  
 
                6 Posts | 
                    
                      |  Posted - 04 May 2015 :  23:01:09     
 |  
                      | It's simple: create a blank new project, put a ctlUniTextBoxXP on the form and paste the code below. Run the app and compare the debug output after the SendKeys command and after you press (shift + a) manually on the keyboard.
 
 Private Sub ctlUniTextBoxXP1_KeyDown(KeyCode As Integer, Shift As Integer)
 Debug.Print "keydown " & KeyCode & " Shift = " & Shift
 End Sub
 
 Private Sub ctlUniTextBoxXP1_KeyUp(KeyCode As Integer, Shift As Integer)
 Debug.Print "keyup " & KeyCode & " Shift = " & Shift
 End Sub
 
 Private Sub Form_Activate()
 ctlUniTextBoxXP1.SetFocus
 SendKeys "(+a)", True
 End Sub
 |  
                      | Edited by - ma.montesi on 04 May 2015  23:01:47
 |  
                      |  |  | 
              
                | ma.montesiNovice
 
  
 
                6 Posts | 
                    
                      |  Posted - 13 May 2015 :  22:44:53     
 |  
                      | Hi Davide, news? |  
                      |  |  | 
              
                | s.davSite Admin
 
      
 
                Italy3364 Posts
 | 
                    
                      |  Posted - 14 May 2015 :  04:06:12       
 |  
                      | marco, 
 mandami una mail che ti allego il file .ocx di prova
 |  
                      | Regards, Davide
 |  
                      |  |  | 
              
                | ma.montesiNovice
 
  
 
                6 Posts | 
                    
                      |  Posted - 14 May 2015 :  23:05:32     
 |  
                      | quote:Originally posted by s.dav
 
 marco,
 
 mandami una mail che ti allego il file .ocx di prova
 
 
 
 Ciao Davide,
 puoi mandarmi l'ocx di prova a questo indirizzo:
 xxxxxxxxxxxxxxx
 
 Grazie, Marco
 |  
                      |  |  | 
              
                | s.davSite Admin
 
      
 
                Italy3364 Posts
 | 
                    
                      |  Posted - 14 May 2015 :  23:55:44       
 |  
                      | Spedito |  
                      | Regards, Davide
 |  
                      |  |  | 
              
                | ma.montesiNovice
 
  
 
                6 Posts | 
                    
                      |  Posted - 17 May 2015 :  23:47:34     
 |  
                      | quote:Originally posted by s.dav
 
 Spedito
 
 
 Scusami Davide ma non ho ricevuto nulla.
 Forse il problema ? nel nostro server di posta che blocca gli allegati.
 Prova a reinviare la mail zippando il file .ocx, oppure mandala a marco.montesi at gmail.com
 
 Grazie, Marco
 |  
                      | Edited by - ma.montesi on 17 May 2015  23:48:20
 |  
                      |  |  | 
              
                | s.davSite Admin
 
      
 
                Italy3364 Posts
 | 
                    
                      |  Posted - 18 May 2015 :  05:07:40       
 |  
                      | l'ho zippato anche la prima volta ;-) |  
                      | Regards, Davide
 |  
                      |  |  | 
              
                | s.davSite Admin
 
      
 
                Italy3364 Posts
 | 
                    
                      |  Posted - 18 May 2015 :  05:07:50       
 |  
                      | riprovo sull'altro indirizzo |  
                      | Regards, Davide
 |  
                      |  |  | 
              
                | nikolausPractical
 
   
 
                Germany20 Posts
 |  | 
              
                |  |  Topic  |  |