473,811 Members | 3,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pop-up login dialog box

Hello,

I am programming in Visual Basic .NET. I have seen examples of creating a
login form to use for users to type in their username and password, but I
want to accomplish the same thing with a pop-up dialog box instead. How can
I make my program bring up a pop-up login dialog box for a user to type in
username and password?

Thanks,
Dusty

Nov 29 '05 #1
18 13555
You can call a login form as a dialog box with the following code:

Dim frmNewDownload As New frmDownload
frmNewDownload. ShowDialog()

That will give your users a dialog box but still allow you to design the
form to your specs.

Curtis

"Dusty Hackney" <Dusty Ha*****@discuss ions.microsoft. com> wrote in message
news:2B******** *************** ***********@mic rosoft.com...
Hello,

I am programming in Visual Basic .NET. I have seen examples of creating a
login form to use for users to type in their username and password, but I
want to accomplish the same thing with a pop-up dialog box instead. How
can
I make my program bring up a pop-up login dialog box for a user to type in
username and password?

Thanks,
Dusty

Nov 29 '05 #2
"Dusty Hackney" <Dusty Ha*****@discuss ions.microsoft. com> schrieb:
I am programming in Visual Basic .NET. I have seen examples of creating a
login form to use for users to type in their username and password, but I
want to accomplish the same thing with a pop-up dialog box instead. How
can
I make my program bring up a pop-up login dialog box for a user to type in
username and password?


If you are using VS 2005:

Select "Project" -> "Add new item..." -> "Login Form" -> "Add". Then use
the following code to display the login dialog:

\\\
Using f As New LoginForm()
If f.ShowDialog = DialogResult.OK Then
Password = f.PasswordTextB ox.Text
Username = f.UsernameTextB ox.Text
End If
End Using
///

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

Nov 29 '05 #3
Herfried,

\\\
Using f As New LoginForm()
If f.ShowDialog = DialogResult.OK Then
Password = f.PasswordTextB ox.Text
Username = f.UsernameTextB ox.Text
End If
End Using
///

It sound strange, however normally it will not needed ot return the
password, that can be checked in the dialog itself. An Ok is more than
enough and than in the code.

If f.showdialog <> dialogresult.OK me.close

A typical question for you. How do I get rit of that error warning (shared
member) with this in VB2005?

Cor


Nov 30 '05 #4
Dusty,

Ever thought doing it without a Login, your users will be glad with you

http://msdn.microsoft.com/library/de...nroletopic.asp

Just as alternative

Cor

"Dusty Hackney" <Dusty Ha*****@discuss ions.microsoft. com> schreef in bericht
news:2B******** *************** ***********@mic rosoft.com...
Hello,

I am programming in Visual Basic .NET. I have seen examples of creating a
login form to use for users to type in their username and password, but I
want to accomplish the same thing with a pop-up dialog box instead. How
can
I make my program bring up a pop-up login dialog box for a user to type in
username and password?

Thanks,
Dusty

Nov 30 '05 #5
Cor,

"Cor Ligthert [MVP]" <no************ @planet.nl> schrieb:
\\\
Using f As New LoginForm()
If f.ShowDialog = DialogResult.OK Then
Password = f.PasswordTextB ox.Text
Username = f.UsernameTextB ox.Text
End If
End Using
///
It sound strange, however normally it will not needed ot return the
password, that can be checked in the dialog itself. An Ok is more than
enough and than in the code.

If f.showdialog <> dialogresult.OK me.close


Mhm... So you think it's a good idea to return 'DialogResult.O K' to
represent valid login data? I do not like this idea. The value of
'DialogResult' should IMO be set by the button selected on the form.
A typical question for you. How do I get rit of that error warning (shared
member) with this in VB2005?


Where's that error warning?

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

Nov 30 '05 #6
> Cor,

"Cor Ligthert [MVP]" <no************ @planet.nl> schrieb:
\\\
Using f As New LoginForm()
If f.ShowDialog = DialogResult.OK Then
Password = f.PasswordTextB ox.Text
Username = f.UsernameTextB ox.Text
End If
End Using
///

It sound strange, however normally it will not needed ot return the
password, that can be checked in the dialog itself. An Ok is more than
enough and than in the code.

If f.showdialog <> dialogresult.OK me.close


Mhm... So you think it's a good idea to return 'DialogResult.O K' to
represent valid login data? I do not like this idea. The value of
'DialogResult' should IMO be set by the button selected on the form.

You don't need that password in your application, so why would you than get
it in that, you only need to verify that the user is a right one. (It can be
that you with this system have to transport back his/hers rights however
that is something else).
A typical question for you. How do I get rit of that error warning
(shared member) with this in VB2005?


Where's that error warning?


Sorry not an error warning, one of those that you like so much a 'warning'.
(which means not like so much)
(Access to a shared member etc)

Windows.Forms.D ialogResult.OK
'gives no warning
DialogResult.OK

'gives warning

Cor


Nov 30 '05 #7
"Cor Ligthert [MVP]" <no************ @planet.nl> schrieb:
\\\
Using f As New LoginForm()
If f.ShowDialog = DialogResult.OK Then
Password = f.PasswordTextB ox.Text
Username = f.UsernameTextB ox.Text
End If
End Using
///

It sound strange, however normally it will not needed ot return the
password, that can be checked in the dialog itself. An Ok is more than
enough and than in the code.

If f.showdialog <> dialogresult.OK me.close


Mhm... So you think it's a good idea to return 'DialogResult.O K' to
represent valid login data? I do not like this idea. The value of
'DialogResult' should IMO be set by the button selected on the form.


You don't need that password in your application, so why would you than
get it in that, you only need to verify that the user is a right one. (It
can be that you with this system have to transport back his/hers rights
however that is something else).


This depends on the case. Maybe you need the password when establishing a
connection to a database. I would not place the database-related code
inside the login dialog.
A typical question for you. How do I get rit of that error warning
(shared member) with this in VB2005?


Where's that error warning?


Sorry not an error warning, one of those that you like so much a
'warning'. (which means not like so much)
(Access to a shared member etc)

Windows.Forms.D ialogResult.OK
'gives no warning
DialogResult.OK

'gives warning


That's interesting. I currently only have the August CTP at hand, but the
code compiles just fine without a warning inside a form, althout the warning
is enabled. However, according to the IDE 'DialogResult' is resolved to the
form's property instead of the enumeration.

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

Nov 30 '05 #8
Herfried,
This depends on the case. Maybe you need the password when establishing a connection to a database. I would not place the database-related code
inside the login dialog.


You get it forever from the database otherwise you can use the
IsInRoleMethod. In my opinion is the logic about the checking the best
placed in that login class (in a seperated DLL) and not spread over a kind
of main class. While you use in that login class of course the logic from
your database layer class(es).

Just my thought,

Cor
Nov 30 '05 #9
"Cor Ligthert [MVP]" <no************ @planet.nl> schrieb:
This depends on the case. Maybe you need the password when establishing
a
connection to a database. I would not place the database-related code
inside the login dialog.


You get it forever from the database otherwise you can use the
IsInRoleMethod. In my opinion is the logic about the checking the best
placed in that login class (in a seperated DLL) and not spread over a kind
of main class. While you use in that login class of course the logic from
your database layer class(es).


Yep, but the login dialog is part of the presentation layer and doesn't
belong to the data layer. And, finally you have to pass login data to the
data layer to establish the connection, for example.

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

Nov 30 '05 #10

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

Similar topics

4
2421
by: Roy Smith | last post by:
In the recent "transforming a list into a string" thread, we've been discussing the fact that list.pop() is O(1), but list.pop(0) is O(n). I decided to do a little timing experiment. To be sure, I did verify experimentally the expected result, but along the way, I came upon an interesting artifact that I'm at a loss to explain. I used the following to generate some timing numbers for pop() on various sized lists: import time
1
2253
by: spencer | last post by:
Hi, The code. def buildStackMajor(): for node in dirStackMinor: #print 's is the node...', node dirStackMajor.append(node) dirStackMinor.pop() print 'POP the stack...', len(dirStackMinor) print 'after pop...', dirStackMinor
6
23211
by: Will | last post by:
Hi, Sorry to be a pest... But I can figure this out. I'm pushing to a stack. then I need to check to see if the word is a palindrome. Is the code below correct? if so, how can I check the entire word?
2
2301
by: John Hoge | last post by:
I would like to open an exit pop when a user leaves my site, but I don't want to the back button to trigger the pop if the user remains in my site. I'm using the onUnload attribute of the Body tag to do this. All internal links set a variable of inSite to true on their onClick event handler, so the exit pop will not open if the user follows an internal link. Should the user hit the back button, the pop will be displayed. Is
15
4171
by: Stig Brautaset | last post by:
Hi group, I'm playing with a little generic linked list/stack library, and have a little problem with the interface of the pop() function. If I used a struct like this it would be simple: struct node { struct node *next; void *data; };
11
2535
by: Vijay Kumar R Zanvar | last post by:
> In <pan.2004.04.22.04.06.05.969827@bar.net> "Mac" <foo@bar.net> writes: > > >Is it legal to declare errno after you've included errno.h? > > > >For example: > > > >#include<errno.h> > > > >... > >
25
4208
by: Nicholas Parsons | last post by:
Howdy Folks, I was just playing around in IDLE at the interactive prompt and typed in dir({}) for the fun of it. I was quite surprised to see a pop method defined there. I mean is that a misnomer or what? From the literature, pop is supposed to be an operation defined for a stack data structure. A stack is defined to be an "ordered" list data structure. Dictionaries in Python have no order but are sequences. Now, does anyone know...
7
24944
by: Scott | last post by:
As said before I'm new to programming, and I need in depth explaination to understand everything the way I want to know it, call it a personality quirk ;p. With pop() you remove the last element of a list and return its value: Now I know list is a bad name, but for the sake of arguement lets assume its not a built in sequence> 'example'
4
2570
by: j_depp_99 | last post by:
The program below fails on execution and I think the error is in my pop function but it all looks correct.Also could someone check my code as to why my print function is not working? I havent included the other parts of my program but will if someone needs it. Please help; I have had it. I have checked all C++ websites and cannot figure it out. <code> template<class Type> void Novice<Type>::Print()
20
5751
by: merrittr | last post by:
I need some C advice I want to read in string commands from a user when the user enters a \n I want to push it on the stac. Then at some point , if the user enters the word print pop off and print each word (or using another stack pointer scan the stack printing each string). here is a stub of what i want to do. (how do I implement this currently my code doesn't work due to my lack of strings and pointers) #include <stdio.h>
0
9731
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10393
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.