Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Other hexagora products
 Programs (Programmi)
 [HELP] ctlUniTextBoxXP, sendkeys and shift
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ma.montesi
Novice

6 Posts

Posted - 29 Apr 2015 :  07:33:54  Show Profile  Reply with Quote
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.dav
Site Admin

Italy
3360 Posts

Posted - 03 May 2015 :  23:09:15  Show Profile  Visit s.dav's Homepage  Reply with Quote
Marco, send me the sample project and I'll check

Regards, Davide
Go to Top of Page

ma.montesi
Novice

6 Posts

Posted - 04 May 2015 :  23:01:09  Show Profile  Reply with Quote
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
Go to Top of Page

ma.montesi
Novice

6 Posts

Posted - 13 May 2015 :  22:44:53  Show Profile  Reply with Quote
Hi Davide, news?
Go to Top of Page

s.dav
Site Admin

Italy
3360 Posts

Posted - 14 May 2015 :  04:06:12  Show Profile  Visit s.dav's Homepage  Reply with Quote
marco,

mandami una mail che ti allego il file .ocx di prova

Regards, Davide
Go to Top of Page

ma.montesi
Novice

6 Posts

Posted - 14 May 2015 :  23:05:32  Show Profile  Reply with Quote
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
Go to Top of Page

s.dav
Site Admin

Italy
3360 Posts

Posted - 14 May 2015 :  23:55:44  Show Profile  Visit s.dav's Homepage  Reply with Quote
Spedito

Regards, Davide
Go to Top of Page

ma.montesi
Novice

6 Posts

Posted - 17 May 2015 :  23:47:34  Show Profile  Reply with Quote
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
Go to Top of Page

s.dav
Site Admin

Italy
3360 Posts

Posted - 18 May 2015 :  05:07:40  Show Profile  Visit s.dav's Homepage  Reply with Quote
l'ho zippato anche la prima volta ;-)

Regards, Davide
Go to Top of Page

s.dav
Site Admin

Italy
3360 Posts

Posted - 18 May 2015 :  05:07:50  Show Profile  Visit s.dav's Homepage  Reply with Quote
riprovo sull'altro indirizzo

Regards, Davide
Go to Top of Page

nikolaus
Practical

Germany
20 Posts

Posted - 25 Jun 2015 :  11:43:41  Show Profile  Visit nikolaus's Homepage  Reply with Quote
as far as I know, SendKeys is unsupported within Win versions Vista plus. For more info, refer the following site:

http://www.vbforums.com/showthread.php?456795-Modifications-Required-for-VB6-Applications-to-Work-on-Vista-7&p=2807202#post2807202

C.U., nikolaus
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000