Solved

Wndows Form and Focus

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

18 Experts available now in Live!

Get 1:1 Help Now