|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
мне нужно при нажатии определенную кнопку выполнялось запрос Например: как кнопка F1, т.е. при нажатии кнопку F1 открывалось окно "помощь" спасибо за помощь ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 09:06 |
|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
Событие KeyDown. ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 09:24 |
|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
Antonariy, а как использовать и где можно найти код клавиш(кнопок) ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 12:59 |
|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
shohAntonariy, а как использовать и где можно найти код клавиш(кнопок) в хелпе по этому событию для F1 - vbKeyF1 ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 13:08 |
|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
Shocker.Pro, у меня в хелпе не показывает, либо из-за версии ПО или не польный пакет установлен Прошу дать синтаксис и если есть/можно пример дать. мне нужно, что бы через клавиатуры нажимая определенные кнопки можно было выполнять какие то действие (как в word, excel) ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 14:13 |
|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
авторСобытие KeyDown. а почему не использовать встроенный функционал офиса Макросы - япараметры - Сочетание клавиш ? ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 14:29 |
|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
shohу меня в хелпе не показывает, либо из-за версии ПО или не польный пакет установлен зато есть msdn что ж теперь, весь хелп вам сюда постить? KeyDown, KeyUp Events Occur when the user presses (KeyDown) or releases (KeyUp) a key while an object has thefocus. (To interpretANSI characters, use the KeyPress event.) Syntax Private Sub Form_KeyDown(keycode As Integer, shift As Integer) Private Sub object_KeyDown([index As Integer,]keycode As Integer, shift As Integer) Private Sub Form_KeyUp(keycode As Integer, shift As Integer) Private Sub object_KeyUp([index As Integer,]keycode As Integer, shift As Integer) The KeyDown and KeyUp event syntaxes have these parts: Part Description object Anobject expression that evaluates to an object in the Applies To list. index An integer that uniquely identifies a control if it's in acontrol array. keycode A key code, such as vbKeyF1 (the F1 key) or vbKeyHome (the HOME key). To specify key codes, use the constants in the Visual Basic (VB)object library in theObject Browser. shift An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event. The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2 ). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT are pressed, the value of shift is 6. Remarks For both events, the object with the focus receives all keystrokes. A form can have the focus only if it has no visible and enabled controls. Although the KeyDown and KeyUp events can apply to most keys, they're most often used for: Extended character keys such asfunction keys. Navigation keys. Combinations of keys with standard keyboard modifiers. Distinguishing between the numeric keypad and regular number keys. Use KeyDown and KeyUp event procedures if you need to respond to both the pressing and releasing of a key. KeyDown and KeyUp aren't invoked for: The ENTER key if the form has a CommandButton control with the Default property set to True. The ESC key if the form has a CommandButton control with the Cancel property set to True. The TAB key. KeyDown and KeyUp interpret the uppercase and lowercase of each character by means of two arguments: keycode, which indicates the physical key (thus returning A and a as the same key) and shift, which indicates the state of shift+key and therefore returns either A or a. If you need to test for the shift argument, you can use the shift constants which define the bits within the argument. The constants have the following values: Constant Value Description vbShiftMask 1 SHIFT key bit mask. VbCtrlMask 2 CTRL key bit mask. VbAltMask 4 ALT key bit mask. The constants act asbit masks that you can use to test for any combination of keys. You test for a condition by first assigning each result to a temporary integer variable and then comparing shift to a bit mask. Use the And operator with the shift argument to test whether the condition is greater than 0, indicating that the modifier was pressed, as in this example: ShiftDown = (Shift And vbShiftMask) > 0 In a procedure, you can test for any combination of conditions, as in this example: If ShiftDown And CtrlDown Then Note If the KeyPreview property is set to True, a form receives these events before controls on the form receive the events. Use the KeyPreview property to create global keyboard-handling routines. KeyDown, KeyUp Events ExampleThis example demonstrates a generic keyboard handler that responds to the F2 key and to all the associated ALT, SHIFT, and CTRL key combinations. The key constants are listed in the Visual Basic (VB) object library in the Object Browser. To try this example, paste the code into the Declarations section of a form that contains a TextBox control, and then press F5 and press F2 with various combinations of the ALT, SHIFT, and CTRL keys. Private Sub Text1_KeyDown (KeyCode As Integer, Shift As Integer) Dim ShiftDown, AltDown, CtrlDown, Txt ShiftDown = (Shift And vbShiftMask) > 0 AltDown = (Shift And vbAltMask) > 0 CtrlDown = (Shift And vbCtrlMask) > 0 If KeyCode = vbKeyF2 Then ' Display key combinations. If ShiftDown And CtrlDown And AltDown Then Txt = "SHIFT+CTRL+ALT+F2." ElseIf ShiftDown And AltDown Then Txt = "SHIFT+ALT+F2." ElseIf ShiftDown And CtrlDown Then Txt = "SHIFT+CTRL+F2." ElseIf CtrlDown And AltDown Then Txt = "CTRL+ALT+F2." ElseIf ShiftDown Then Txt = "SHIFT+F2." ElseIf CtrlDown Then Txt = "CTRL+F2." ElseIf AltDown Then Txt = "ALT+F2." ElseIf SHIFT = 0 Then Txt = "F2." End If Text1.Text = "You pressed " & Txt End If End Sub ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 14:53 |
|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
shoh, вариант Application.Run "Normal.Модуль_ЦЭ.Макрос_ЦЭ" по этому скрипту Вам придётся в Нормал.дот заиметь модуль "ЦЭ" и макрос "ЦЭ" ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 17:55 |
|
мне нужно при нажатии определенную кнопку выполнялось запрос
|
|||
---|---|---|---|
#18+
Shocker.Pro, ВСЕМ ОГРОМНОЕ СПАСИБО , отдельное спасибо Shocker.Pro ... |
|||
:
Нравится:
Не нравится:
|
|||
26.11.2010, 13:54 |
|
|
start [/forum/topic.php?fid=60&fpage=114&tid=2159209]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
33ms |
get topic data: |
14ms |
get forum data: |
3ms |
get page messages: |
49ms |
get tp. blocked users: |
2ms |
others: | 322ms |
total: | 455ms |
0 / 0 |