How do I bring a User control to the front in a form - vb.net

I have a loginForm.vb, and 3 user controls: promptEmail.vb, promptLogin.vb, promptEmailRecovery.vb.
When I launch the app I want the Login Form to load the promptLogin.vb by bringing it to front.
Then when I click forgot password which is a button in promptLogin.vb, I want it to load the promptEmailRecovery.vb and hide the prompt login.
How can this be done?

Bring the login prompt to the front in the designer through its context menu there. Then it'll be in front when the form loads.
In the .Click event handler for the forgot password button, Call .BringToFront() on the promptEmailRecovery user control.

Related

VB - Form 2 closes automatically whenever Form 1 closes?

So right now, I'm so frustrated because there is ONE little problem that stops me from continue working on my programm.
I made a simple Login Form where the user must type in a password and when he failed after 3 attempts, the form will close. BUT if the user enters a correct password, a button will become visible and he can Login and another Form with the main programm will open. So I want to close the Login Form when the user presses the Login button and the Form 2 will appear. Simple Code:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
logint = 1
Form2.Show()
Me.Close()
logint handels the attempt counter... WHATEVER.. the MAIN PROBLEM is, that whenever I press Login the Login closes instantly and the form 2 pops up, stays for like 2 Seconds and closes right after that. I searched both codes and there is no "Form2.Close() " or "Me.Close()" which could cause that error. Form 2 always exits with Code 0 (0x0). What can I do if I want just the Login Form closed and the Main form loaded?
If you right click on your project and select the Propeties voice from the Popup menu and switch to the Application page you will notice a combobox that says:
Shutdown mode = When Startup Form close.
Your startup form is the Login form, so when it closes your app terminates.
You can change this settings to
Shutdown mode = When last form closes.
However, pay attention to not have orphaned forms around your application otherwise it will never stop.
A better approach is to start your application with the normal form and in its constructor execute the login form. If the login form doesn't allow your application to continue, set a global variable and Close the main form in its Load event.

How to disable main form when another form is open in vb

I'm working on my project in VB. Can anyone help me how to disable my main(not close) form when I open my login form?
Like when I click on the login button the login form will appear and the main form will just stay in background and it cannot be closed or moved unless the login form will be closed?
Look into the subject of a "modal" dialog box. You can instantiate one as follows:
Dim frmLogin as New Form()
' Display frmLogin as a modal dialog
frmLogin.ShowDialog()
This means that this form will have to be handled by the user before any other forms can be used.

VB setFocus after Typing in Textbox without losing it

I have a login screen where I set the focus to be on the password textbox so that the user can start typing their password without clicking anything.
I want to set the focus to the login button as soon as a character is typed into the password textbox so that the user can just hit Enter when they're done typing in the password.
I don't want to lose focus on the password textbox, but I want the login button to be highlighted so that you can hit Enter.
Right now I have to hit Tab, then Enter for this to work.
Set the Form.Accept Property of your Form to the Button's Name:
Gets or sets the button on the form that is clicked when the user
presses the ENTER key.
Then when the user is done entering their password and hits enter your button will be clicked automatically for them.
Figured it out. Went to the Property Sheet for the Login button and the Default property was set to No. Changed it to Yes and it works perfectly. Thanks.

How to maintain text in popup control even if click outside popup control

In my windows phone application I add one popup control for user login.
If user enter his credentials and click outside popup control then the data vanishes.
how to maintain data in popup even if user clicked outside popup?
Is there any property so that we can make background page ideal when popup window comes?
use IsolatedStorage for that to maintain data.
see the link
http://www.kunal-chowdhury.com/2011/06/windows-phone-7-mango-tutorial-12-using.html
hope this will help you...

Dotnetnuke popup login control with the modalpopupextender

I'm trying to create a modal popup login control for dnn using the ModalPopupExtender in the AjaxToolkit. An issue that I'm running into is that when I click the "Login" button on the popup login form, if the login fails for some reason or if the user needs to update some information before moving on, the modal popup is cleared and the user is never notified that they need to change the information and the login cannot proceed.
Does the ModalPopupExtender provide the ability somehow, to mimic a wizard type of interface so that if my login failed then the next control would be rendered in the popup (e.g. "user must change password"). Someone please help.
You can use the wizard control inside of the modalpopupextender.