you probably have to set the "keypreview"-property of the form to
"true"
As I didn't find the property in the property-listbox I added
salesorderform.keypreview = true
at the form.load-event.
Jan
--- In vantage@yahoogroups.com, "Michael
McWilliams" <mmcwilliams22@...> wrote:
"true"
As I didn't find the property in the property-listbox I added
salesorderform.keypreview = true
at the form.load-event.
Jan
--- In vantage@yahoogroups.com, "Michael
McWilliams" <mmcwilliams22@...> wrote:
>args
> What is the code you are running from that to fire the button. I
> could not get it to work on any of the forms. I tested using a
> messagebox.
> Here is what my code looked like
> Private Sup SalesOrderForm_KeyUp(ByVal sender As object, ByVal args
> As System.Windows.Forms.KeyEventArgs) Handles SalesOrderForm.KeyUp
> If Args.KeyCode = Keys.F2 Then
> MessageBox.Show ("You Hit F2")
>
>
> --- In vantage@yahoogroups.com, "backbencherjan" <jehrlenbach@>
> wrote:
> >
> > works now ;)
> >
> > had to use
> >
> > Private Sub SalesOrderForm_KeyUp(ByVal sender As object, ByVal
> > As System.Windows.Forms.KeyEventArgs) Handles SalesOrderForm.KeyUp"backbencherjan" <jehrlenbach@>
> >
> > to get the event.
> >
> > Thanks to all
> > Jan
> >
> > --- In vantage@yahoogroups.com, "backbencherjan" <jehrlenbach@>
> > wrote:
> > >
> > > Thanks!
> > > It works fine as long the focus is on the button.
> > > If I try it on the form itself i get the following error:
> > >
> > > Method 'SalesOrderForm_KeyUp' cannot handle Event 'Keydown'
> because
> > > they do not have the same signature.
> > >
> > > Any idea how to get this working? (or what the error means?)
> > >
> > > Thanks
> > > Jan
> > >
> > > P.S.:sorry, I'm still kinda new to .net
> > >
> > > --- In vantage@yahoogroups.com, "Michael
> > > McWilliams" <mmcwilliams22@> wrote:
> > > >
> > > > I was thinking backwards.
> > > > You can try something like:
> > > > Private Sub nedEpiCustom1_KeyUp(ByVal Sender As Object,
> ByVal
> > > Args
> > > > As System.Windows.Forms.KeyEventArgs) Handles
> nedEpiCustom1.KeyUp
> > > >
> > > > If Args.KeyCode = Keys.F2 Then
> > > >
> > > > //**Whatever Code You Want to Run
> > > >
> > > > But you have to hit f2 when in nedEpiCustom1
> > > >
> > > > I am not sure how or if it can work by using the form or
> > something
> > > > else. Say QuoteForm_KeyUp
> > > >
> > > >
> > > >
> > > >
> > > > --- In vantage@yahoogroups.com,
> > > > wrote:Wonsil" <mark_wonsil@>
> > > > >
> > > > > --- In vantage@yahoogroups.com, "Mark
> > > wrote:pressed.
> > > > > >
> > > > > > > Private Sub btnEpiCustom1_Click(ByVal Sender As Object,
> > ByVal
> > > > > Args As
> > > > > > > System.EventArgs) Handles btnEpiCustom1.Click
> > > > > > > Sendkeys.Send("{F2}")
> > > > > > >
> > > > > > > When the button is clicked it will send F2
> > > > > >
> > > > > > Was Jan asking for this or the opposite? Did she want to
> > assign
> > > > F2
> > > > > to her
> > > > > > EpiButton?
> > > > > >
> > > > > actually I wanted just the opposite :)
> > > > > So, if a user presses F2 the custom button should be
> > > > >
> > > > > Thanks
> > > > > Jan
> > > > >
> > > >
> > >
> >
>