Solved

Wndows Form and Focus

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to limit User Input 2 27
Sending an input value from a view to a controller in MVC 3 23
transition to visual .net from vb6 5 40
Groupbox Control ? 2 19
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)…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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