Solved

I Have problem when I prass F10 , if I have combobox

Posted on 2008-06-10
2
332 Views
Last Modified: 2013-11-26
I used this code to save the data through pressing On F10



======================

    Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean
        Select Case keyData
            Case (Keys.F10)

              ' My save code

        End Select
        Return MyBase.ProcessDialogKey(keyData)

    End Function

===================


It's Ok saved
but if I have combo box in the form, it's will save two times

I made example for you

this is my code

note (don't forget put combobox in the form )

=======================

    Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean
        Select Case keyData
            Case (Keys.F10)

                MsgBox(" Save")
        End Select
        Return MyBase.ProcessDialogKey(keyData)

    End Function

=====================

It's will give you two messages
0
Comment
Question by:SystemSys
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 21760462
Return True when you get the F10 key:

    Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean

        Select Case keyData

            Case (Keys.F10)
 

              ' My save code
 

              Return True
 

        End Select
 

        Return MyBase.ProcessDialogKey(keyData)

    End Function

Open in new window

0
 

Author Closing Comment

by:SystemSys
ID: 31466037
Thaaaaaaaaaaaaaanks  Idle_Mind , That is OK
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now