Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8996211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:43:27+00:00 2026-06-15T23:43:27+00:00

From time to time I use code to simulate key event. Like this: Dim

  • 0

From time to time I use code to simulate key event.
Like this:

Dim kea As New KeyEventArgs(Keys.N)
DataGridView1_KeyDown(sender, kea)

That work’s good.
Now I need same way to send Ctrl+N.
But I can’t find how to do this.

What I try…

Dim kea As New KeyEventArgs(Keys.N And Keys.ControlKey)

But that don’t want to work as expected.

How to do this properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:43:27+00:00Added an answer on June 15, 2026 at 11:43 pm

    As you could have read in the MSDN documentation, you should combine the keys with the bitwise OR operator:

    Dim kea As New KeyEventArgs(Keys.N Or Keys.Control)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My code snippet look like this: from time import sleep for i in xrange(10):
I use cast() from the reshape package quite frequently. Almost every time, this warning
From time to time I see something like this: class Clazz { private int
I'd like to create schema automatically, if not exists. Currently I use this code
I am using this code to get the time from the Time Picker. .
I have use some code to take time from NTP (Network Time Protocol). I
I use both Firebird embedded and Firebird Server, and from time to time I
I use ScheduledExecutorService in my application. I need to use it from time to
What I'm trying to do is to use ajax to get time from another
How to extract time portion from a Date-object and use it as a String

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.