Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Form with tabcontrol, 3 of 5 tabs are NOT allowing user data entry in textboxes

$
0
0

As stated above, form with multiple tab pages in a TabControl collection, two of the five tab pages work fine, user can edit everything and save fine.  On the remaining tabs, Textboxes do not allow user data entry.  All page elements are enabled, there is a series of keypress events to limit user to numerical data entry only, but I don't see anything in the code that would be barring them from all data entry.  

The only unusual event I'm aware of is there was a designer error the other day, but I exited without saving any changes, reloaded, and it went away, so I recreated the code since the last save point (no, no version control software)

Have already tried deleting and recreating the textboxes, no changes

Below is all of the code (other than the save button click event code) which deals with the textboxes for one of the tabs in question

 Private Sub T3Textbox_AutoDirtyFunctions(sender As System.Object, e As System.EventArgs) Handles T3txtCustomers.LostFocus, T3txtPS.LostFocus, T3txtME.LostFocus, T3txtPE.LostFocus, T3txtOth.LostFocus, T3txtTTL.LostFocus
        '//////////////////////
        'auto dirty if not in setup mode
        '//////////////////////
        If setupPage = False Then
            isdirty = True

            If sender Is T3txtCustomers Then dirtyT3Consumers = True
            If sender Is T3txtPS Then dirtyT3PS = True
            If sender Is T3txtME Then dirtyT3ME = True
            If sender Is T3txtPE Then dirtyT3PE = True
            If sender Is T3txtOth Then dirtyT3Oth = True
            If sender Is T3txtTTL Then dirtyT3TTL = True

        End If

    End Sub

Private Sub t3Textbox_KeypressLimits(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles T3txtCustomers.KeyPress, T3txtPS.KeyPress, T3txtME.KeyPress, T3txtPE.KeyPress, T3txtOth.KeyPress, T3txtTTL.KeyPress
        '//////////////////////
        'limit to integers and decimals, as appropriate
        '//////////////////////
        If sender Is T3txtCustomers Then
            KeypressLimits(0, e)    'integers only

        Else
            KeypressLimits(1, e)    'decimals or integers allowed

        End If

    End Sub

 Public Sub KeypressLimits(ByVal i As Integer, e As System.Windows.Forms.KeyPressEventArgs)
        '///////////////////////////////
        'handles limitations on textboxes
        '0 = numbers & backspace only
        '1 = numbers, backspace, & decimal
        '//////////////////////////////
        Select Case i
            Case 0
                Select Case e.KeyChar
                    Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", vbBack
                        e.Handled = False
                    Case Else
                        e.Handled = True
                End Select
            Case 1
                Select Case e.KeyChar
                    Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", vbBack, "."
                        e.Handled = False
                    Case Else
                        e.Handled = True
                End Select

        End Select
    End Sub

Environment:  

  • VS2013 Community (Update 4)
  • Win8.1, with 8gb ram (surface pro 3)
  • SqlExpress2012 server on the backend
  • VB program
  • compiled as (x86)


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>