Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Trainee
Date of registration: Nov 24th 2008
Location: Cologne, Germany
Occupation: Second Vice President of Distributed Junk and Trash Development
Trainee
Date of registration: Nov 24th 2008
Location: Cologne, Germany
Occupation: Second Vice President of Distributed Junk and Trash Development
Quoted from "OlimilO"
Das ist in VB6 sogar noch einfacher.
Quoted from "OlimilO"
* im Form/Dialog das Interface java#awt#Event#KeyListener implementieren
Quoted from "OlimilO"
* das Form/Dialog mit AddKeyEventListener auf alle Controls adden.
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
Implements java#awt#Event#KeyListener Public Sub cmdCancel_Click() Me.Close End Sub Public Sub cmdOK_Click() ' [Stuff] Me.Close End Sub Public Sub Form_Load() cmdOK.Parent.addKeyListener(Me) ' funktioniert cmdCancel.Parent.addKeyListener(Me) ' funktioniert lblDescription.Parent.addKeyListener(Me) ' funktioniert txtDescription.Parent.addKeyListener(Me) ' funktioniert Me.Parent.addKeyListener(Me) ' funktioniert nicht :( End Sub Public Sub keyTyped(arg2 As KeyEvent) End Sub Public Sub keyPressed(arg2 As KeyEvent) Debug.Print arg2 End Sub Public Sub keyReleased(arg2 As KeyEvent) End Sub |
Jabaco Source |
|
1 |
Me.Parent.addKeyListener(Me) |
Jabaco Source |
|
1 |
Me.ContentFrame.Parent.addKeyListener(Me) |
Trainee
Date of registration: Nov 24th 2008
Location: Cologne, Germany
Occupation: Second Vice President of Distributed Junk and Trash Development
Quoted from "OlimilO"
Jabaco Source
1 Me.ContentFrame.Parent.addKeyListener(Me)
Jabaco Source |
|
1 2 3 |
For Each C As Control In Me.Controls C.Parent.addKeyListener(Me) Next |
Jabaco Source |
|
1 2 3 |
Me.Parent.addKeyListener(Me) 'und Me.ContentFrame.Parent.addKeyListener(Me) |
die gibt es schon siehe ContentFrame.Parent.getComponentCount, und ContentFrame.Parent.getComponent(i)Quoted
Es gibt nicht zufälligerweise eine Controls-Auflistung, über die man iterieren kann, oder
Trainee
Date of registration: Nov 24th 2008
Location: Cologne, Germany
Occupation: Second Vice President of Distributed Junk and Trash Development
Jabaco Source |
|
1 2 3 4 5 6 7 8 |
Me.Parent.addKeyListener(Me) Me.ContentFrame.Parent.addKeyListener(Me) For Counter = 0 To Me.ContentFrame.Parent.getComponentCount - 1 Dim myComponent As Component = Me.ContentFrame.Parent.getComponent(Counter) Debug.Print myComponent.getClass.toString myComponent.addKeyListener(Me) Next |
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Jabaco Source |
|
1 2 3 4 5 6 7 8 |
Public Sub keyPressed(e As KeyEvent) If Me.MultiLine = False Then If e.getKeyCode = KeyEvent.VK_ENTER Then e.consume End If End If RaiseEvent KeyDown(KeyEventToKeyCode(e), KeyEventToShiftConstant(e)) End Sub |