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

  • SEARCH
  • Home
  • 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 6676851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:02:38+00:00 2026-05-26T04:02:38+00:00

using VB.Net Code If e.Modifiers = Keys.Control And e.KeyCode = Keys.Enter Then If textbox1.Focus()

  • 0

using VB.Net

Code

 If e.Modifiers = Keys.Control And e.KeyCode = Keys.Enter Then
            If textbox1.Focus() = True Then
                frmList.sFormID = 54
                frmList.Show()
            ElseIf textbox2.Focus() = True Then
                frmList.sFormID = 55
                frmList.Show()
            End If
End If

When textbox1.focus() at that time i clicked Control + Enter key, the formid=55 is showing instead of formid=54.

What wrong with my code.

Need code help

  • 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-05-26T04:02:39+00:00Added an answer on May 26, 2026 at 4:02 am

    Try the following:

    If e.Modifiers = Keys.Control And e.KeyCode = Keys.Enter Then
                If textbox1.Focused = True Then
                    frmList.sFormID = 54
                    frmList.Show()
                ElseIf textbox2.Focused = True Then
                    frmList.sFormID = 55
                    frmList.Show()
                End If
    End If
    

    Note that I changed the test condition to check for control focus. Your test condition is attempting to set focus to a text box but in failure, you are probably seeing a default value – e.g., the formid 55. Without seeing more of what frmList is, I’m really only guessing. Is this in an event method? If so, can you provide that code?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I modify the PDF document properties programmatically using .NET code? I have
I am using vb.net code. I have grid view, please see the code below:
I was looking into using some .NET code from within a Delphi program, I
I develop code using .net, and sometimes using ruby. My friend wants me to
I'm using the .NET TWAIN code from http://www.codeproject.com/KB/dotnet/twaindotnet.aspx?msg=1007385#xx1007385xx in my application. When I try
how to set ASP.NET version for virtual directory using c#.net FROM CODE for all
The following code generates a FileNotFoundException (using .NET 2.0): using System; using System.Collections.Generic; using
I'm using .NET Regular Expressions to strip HTML code. Using something like: <title>(?<Title>[\w\W]+?)</title>[\w\W]+?<div class=article>(?<Text>[\w\W]+?)</div>
I am using VB.NET and below code on button click event. Protected Sub ibtnSendInvites_Click(ByVal
We are using ankhsvn to check in our .net code, however I have two

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.