Solved

Wndows Form and Focus

Posted on 2014-03-30
1
281 Views
Last Modified: 2014-04-01
I have a simple windows form that has a few labels and masked text boxes.
All controls are set to visible = false except for the first label and masked textbox.

What I am trying to do is when I enter the data into the masked txtbox, the next label and masked textbox shows visible=true.

The problem I am having , when I hit tab to change focus, there are no other controls to switch to as they are visible=false.

I tried to change visible=truse on the next control on leave but that does not seem to work.

Any ideas?

Thnaks
0
Comment
Question by:Jedidia
1 Comment
 
LVL 24

Accepted Solution

by:
mankowitz earned 275 total points
ID: 39964941
Probably the best thing to do is make the next box appear when the textchanged event fires from the maskededitbox. It's not beautiful, but it would work. The other option is to capture the tab or enter key.

Here is an example:

    Private Sub TextBox1_PreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles MaskedTextBox1.PreviewKeyDown
        If e.KeyData = Keys.Tab Then
            Label2.Visible = True
            MaskedTextBox2.Visible = True
        End If
    End Sub

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question