Solved

Wndows Form and Focus

Posted on 2014-03-30
1
276 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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)…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

919 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now