473,407 Members | 2,676 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,407 software developers and data experts.

showdialog login form - login fail, close the app

Hi,
I have a simple MDIChild login form that loads before the parent, and if the
user hit's the cancel button on the login form, the whole app should unload.
How can I do this? Thanks
Nov 15 '05 #1
5 1944
Walter wrote:
Hi,
I have a simple MDIChild login form that loads before the parent, and
if the user hit's the cancel button on the login form, the whole app
should unload. How can I do this? Thanks


Code the cancel button to set your form's DialogResult to
DialogResult.Cancel before closing itself. In the calling routine, bail
if the user cancelled.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Nov 15 '05 #2
Thanks!
"Frank Oquendo" <fr*******@acadx.com> wrote in message
news:OW*************@TK2MSFTNGP10.phx.gbl...
Walter wrote:
Hi,
I have a simple MDIChild login form that loads before the parent, and
if the user hit's the cancel button on the login form, the whole app
should unload. How can I do this? Thanks


Code the cancel button to set your form's DialogResult to
DialogResult.Cancel before closing itself. In the calling routine, bail
if the user cancelled.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)

Nov 15 '05 #3
Got time for one more? How can I set a property on the mdiParent form from
the Child form?
thanks.
"Frank Oquendo" <fr*******@acadx.com> wrote in message
news:OW*************@TK2MSFTNGP10.phx.gbl...
Walter wrote:
Hi,
I have a simple MDIChild login form that loads before the parent, and
if the user hit's the cancel button on the login form, the whole app
should unload. How can I do this? Thanks


Code the cancel button to set your form's DialogResult to
DialogResult.Cancel before closing itself. In the calling routine, bail
if the user cancelled.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)

Nov 15 '05 #4
Pass the parent as a paramter when you create the child.

MyChild newChild = new MyChild(this);

And add or change the constructor on the child class to accept a parent
parameter

private Parent parent;

public MyChild(Parent parent)
{
this.parent = parent;
}

then call parent.Property when you need it

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #5
Sorry, I keep getting the below error on these lines:

private Parent parent;
public MyChild(Parent parent)

'System.Windows.Forms.Control.Parent' denotes a 'property' where a 'class'
was expected

thanks.

"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:opryii7kmvhntkfz@localhost...
Pass the parent as a paramter when you create the child.

MyChild newChild = new MyChild(this);

And add or change the constructor on the child class to accept a parent
parameter

private Parent parent;

public MyChild(Parent parent)
{
this.parent = parent;
}

then call parent.Property when you need it

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #6

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

Similar topics

3
by: GATMAN | last post by:
Dim f As New frmWeb f.ShowDialog(Me) f.Dispose() Annytime i call a diffrent form from my main form using showdialog, i get an exception eror thrown when i close the form, but when i use f.show i...
2
by: Bill Burris | last post by:
When you crate a Windows application the wizard adds a line like: Application.Run( new MyMainForm() ); Out of curiosity I replaced this with: MyMainForm myForm = new MyMainForm();...
5
by: Josh Golden | last post by:
3 forms. form 1, when button clicked instantiates form 2 which opens but is not shown. form 2 instantiates form 3 as showdialog. form 3 finishes, raises an event that form 2 catches. during the...
2
by: Wardeaux | last post by:
All, I have login form used with ShowDialog(). I have the AcceptButton property set so that the "Enter" key is mapped. I also need to keep the dialog open when the UserID and PWD are invalid so...
4
by: Dennis Sjogren | last post by:
Greetings! First, I'm not 100% sure where to post this question. I use VB.NET for this project, but it's really a design question (a question on which method to use when solving this problem). ...
2
by: **Developer** | last post by:
I have a little more info about this problem I can't seem to solve! I know it'll take a minute to study the lising but if you like to sove puzzles there is one there. I have a Form (FV&C)...
4
by: Chris Dunaway | last post by:
I have a main form with a "lock" button. When the lock button is clicked, another form is shown using ShowDialog(this). The user must enter their PIN on this form to close it and resume the main...
5
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I...
5
by: mcfly1204 | last post by:
I am attempting to use WebRequest to access a page that requires a login/password to access. My last WebRequest continues to timeout. Any help or thoughts would be appreciated. namespace...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...
0
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...

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.