473,385 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Opening a window and then closing self

UJ
I am trying to do a login screen and can't figure out how to get the new
window to open after I have verified the user info. I tried the following:

dim win_Main as MainWindow

win_Main = new MainWindow
Main.Show()
me.close()

but as expected, everything closes down. There must be an easy way to do
this that I just don't know about. I also am going to need to transfer
things to the new window (like the username, privs, ...) any help would be
appreciated.

TIA

UJ.
Nov 21 '05 #1
4 944
"UJ" <UJ@nowhere.com> schrieb:
I am trying to do a login screen and can't figure out how to get the new
window to open after I have verified the user info. I tried the following:

dim win_Main as MainWindow

win_Main = new MainWindow
Main.Show()
me.close()

but as expected, everything closes down. There must be an easy way to do
this that I just don't know about. I also am going to need to transfer
things to the new window (like the username, privs, ...) any help would be
appreciated.


\\\
Public Module Program
Public Sub Main()
Dim f As New Form1()
f.Show()
Application.Run()
End Sub
End Module
///

In the project properties, select 'Sub Main' as startup object. Place the
code below in a button's 'Click' event handler:

\\\
Dim f2 As New Form2()
f2.Show()
Me.Close()
///

You can exit the application by calling 'Application.ExitThread'. Take a
look at the 'ApplicationContext' class too.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
UJ,

The most simple thing for answers on this is seaching the newsgroups in
Google, your question is asked 1000 times at least.

The in my opinion most simple approach

In the load event of your main form.
\\\
dim frm as new LoginForm
frm.showdialog
loginname = frm.loginname 'where loginname is a public property or field in
LoginForm
password = frm.password 'see above
frm.dispose
///
I hope this helps?

Cor
Nov 21 '05 #3
UJ
Thanks Herfried. That worked.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
"UJ" <UJ@nowhere.com> schrieb:
I am trying to do a login screen and can't figure out how to get the new
window to open after I have verified the user info. I tried the following:

dim win_Main as MainWindow

win_Main = new MainWindow
Main.Show()
me.close()

but as expected, everything closes down. There must be an easy way to do
this that I just don't know about. I also am going to need to transfer
things to the new window (like the username, privs, ...) any help would
be appreciated.


\\\
Public Module Program
Public Sub Main()
Dim f As New Form1()
f.Show()
Application.Run()
End Sub
End Module
///

In the project properties, select 'Sub Main' as startup object. Place the
code below in a button's 'Click' event handler:

\\\
Dim f2 As New Form2()
f2.Show()
Me.Close()
///

You can exit the application by calling 'Application.ExitThread'. Take a
look at the 'ApplicationContext' class too.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
"UJ" <UJ@nowhere.com> wrote in news:e4**************@tk2msftngp13.phx.gbl:
I am trying to do a login screen and can't figure out how to get the new
window to open after I have verified the user info. I tried the following:

dim win_Main as MainWindow

win_Main = new MainWindow
Main.Show()
me.close()


Might be too basic for you - but this might be of some assitance as well:
http://www.codeproject.com/useritems...thWinForms.asp
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Get your ASP.NET in gear with IntraWeb!
http://www.atozed.com/IntraWeb/
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sibylle Koczian | last post by:
Still trying to learn PyQt from a book about several Python GUI toolkits, I seem to learn first what doesn't work. The following small script seems to work, but after closing the window I get the...
6
by: Clara | last post by:
Hi,... I meant to write an application where there is a button in a window and when you click on the button, it will open a new window, but I want the first window to close, replaced by the second...
1
by: MJEASSOC | last post by:
I need some help with closing a popup window. I'm making an online portfolio, that has one base page with text and thumbnails. When a user clicks on a thumb, a new window opens containing a larger...
4
by: Peter Pagé | last post by:
Hi, I've got a window with a "<body onBlur="window.close()"> tag that keeps closing prematurely. It happens when the user clicks on text inside a table in the same window. Apparently IE...
7
by: mg | last post by:
Once opening WebForm2 from WebForm1 using Response.Write("<script language='javascript'>window.open ('WebForm2.aspx','two','menubar=no');</script>"); how can I close WebForm1?
2
by: Patrick Olurotimi Ige | last post by:
Is there a possibility to close a Window after pressing a button to open a new window? Thx *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get...
6
by: Joe | last post by:
Hi, I have a form with Submit and cancel button. When Cancel button is clicked I want to close the browser window. Here is my sample form. To make things simple I have removed the submit button....
3
by: globalrev | last post by:
im doing this : http://www.learningpython.com/2006/03/12/creating-a-game-in-python-using-pygame-part-one/ and when closing the program the window stays up and doesnt respond. i tried adding...
0
by: bbrewder | last post by:
I am struggling with some MSAccess automation issues. Basically, we have a .Net application that uses MSAccess for reporting (legacy code). We are able to launch MSAccess fine and even work with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.