VBNET2008 TextBox mysterious problem


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: VBNET2008 TextBox mysterious problem

  1. #1
    Join Date
    Jan 2005
    Location
    New Zealand
    Posts
    319

    RESOLVED - VBNET2008 TextBox mysterious problem

    Hi Good Guys,

    VB.NET 2008 Window Application.

    I have encountered another funny problem relating to textbox control.
    I have 2 FORMs, (FrmMainMenu, FrmOrderInput).

    Events.
    On the FrmMainMenu, click on the ORDERINPUT button will load the FrmOrderInput form for data entry. The weird problem occurred when input is made on any TextBox on FrmOrderInput. The dataentry action will close the FrmOrdInput.

    I need your help to sort out this funny problem. It has not happened when I was using VB,NET 2003 but Vb.NET 2008 is no behaving.
    Last edited by Lennie; 02-28-2010 at 04:56 AM. Reason: problem resolved
    Cheers,
    Lennie

  2. #2
    Join Date
    May 2004
    Location
    Duluth MN
    Posts
    353
    Some questions.

    Does the form close when entering data or when exiting the control. Are you tabbing out or hitting enter? Is there any code in the textbox events? Is there any code trapping keypresses in the form events?

    ...joe

  3. #3
    Join Date
    Jan 2005
    Location
    New Zealand
    Posts
    319
    Hi Joewmaki,
    I made a very careless and silly mistake in my coding.

    I have finally fixed it by changing these coding

    Private Sub FrmOrderInput_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    l
    If e.KeyCode = Keys.Enter Then
    me.close
    End If

    End Sub


    To these working Coding:

    Private Sub FrmOrderInput_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

    If e.KeyCode = Keys.Escape Then
    me.close
    End If

    End Sub



    Thank you very much for trying to help me. You are awesome.
    Cheers,
    Lennie

Similar Threads

  1. Replies: 7
    Last Post: 11-03-2009, 07:59 AM
  2. multiline textbox to printdocument
    By COMPCAD in forum .NET
    Replies: 1
    Last Post: 10-21-2009, 06:56 PM
  3. CMR problem
    By vikassheelgupta in forum Java
    Replies: 0
    Last Post: 07-22-2005, 05:35 AM
  4. Java Applet Compiler problem?
    By mdl in forum Java
    Replies: 3
    Last Post: 03-07-2005, 02:34 AM
  5. textbox problem
    By Jeff in forum .NET
    Replies: 0
    Last Post: 05-29-2002, 05:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center