Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invoking a Hot Key command on similar buttons in a page frame.

Status
Not open for further replies.

ToeJamNEarl

Programmer
Jan 26, 2004
91
US
Hello all,

It has been a little whiles since I've posted here. Been doing fine. I am looking for some help and guidance.


In my application I have a PageFrame that has two similar buttons on them (OK, Cancel). I want to be able to use the hotkey alt+O whenever I am on either page and have it apply to the Current Page's OK Button. How would I go about accomplishing this?

Thanks for the time.

-Diran
 
Quick Edit:

Hey Guys, when I say PageFrame I mean TabStrip.

Any ideas?
 
There has to be a way to edit a post. I meant that I am using an SSTab Control.
 
Have you been to VB help for the vbKey commands?

Example:

Here's some code from vb HELP

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
 
Thanks for the help, but I am goign with an alternate approach a co-worker and I came up with.

We decided that it'll be better to have only one OK and Cancel buttons on the form, bring them to the front, and then inside the buttons to check which strib is chosen and handle the code for it.


Thanks again

-Diran

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top