Click here to Skip to main content
16,007,779 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing Variable to Parent form Pin
benjamin yap11-May-08 23:33
benjamin yap11-May-08 23:33 
GeneralRe: Passing Variable to Parent form Pin
Christian Graus11-May-08 23:54
protectorChristian Graus11-May-08 23:54 
GeneralRe: Passing Variable to Parent form Pin
benjamin yap12-May-08 0:02
benjamin yap12-May-08 0:02 
GeneralRe: Passing Variable to Parent form Pin
Christian Graus12-May-08 0:04
protectorChristian Graus12-May-08 0:04 
GeneralRe: Passing Variable to Parent form Pin
benjamin yap12-May-08 0:10
benjamin yap12-May-08 0:10 
GeneralRe: Passing Variable to Parent form Pin
natsuyaki12-May-08 0:13
natsuyaki12-May-08 0:13 
GeneralRe: Passing Variable to Parent form Pin
Christian Graus12-May-08 0:14
protectorChristian Graus12-May-08 0:14 
GeneralRe: Passing Variable to Parent form Pin
Christian Graus12-May-08 0:13
protectorChristian Graus12-May-08 0:13 
benjamin yap wrote:
childLogin.MdiParent = this;


This is why you can't do it. Get rid of this line, it makes no sense to have it. Set te Owner property instead ( or Parent, I forget which, but I think it's Owner you want ). This stops your modal form from ever being hidden by it's parent.

benjamin yap wrote:
stripLblLoginAs.Text = "Login As :";


This is going to occur *after* your login form has shown.

Now the easy easy way to make this work is to set the DIalogResult to DialogResult.OK only if the login succeeds. Then you can do

if (childLogin.ShowDialog() == DialogResult.OK)
{
// logged in
}
else
{
// failed, close the program or whatever
}

Christian Graus

Please read this if you don't understand the answer I've given you

"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

GeneralRe: Passing Variable to Parent form Pin
benjamin yap12-May-08 0:25
benjamin yap12-May-08 0:25 
GeneralRe: Passing Variable to Parent form Pin
Christian Graus12-May-08 0:44
protectorChristian Graus12-May-08 0:44 
GeneralRe: Passing Variable to Parent form Pin
natsuyaki12-May-08 0:51
natsuyaki12-May-08 0:51 
GeneralRe: Passing Variable to Parent form Pin
benjamin yap12-May-08 1:57
benjamin yap12-May-08 1:57 
GeneralRe: Passing Variable to Parent form Pin
natsuyaki12-May-08 2:09
natsuyaki12-May-08 2:09 
GeneralRe: Passing Variable to Parent form Pin
benjamin yap12-May-08 3:02
benjamin yap12-May-08 3:02 
GeneralRe: Passing Variable to Parent form [modified] Pin
natsuyaki12-May-08 3:54
natsuyaki12-May-08 3:54 
AnswerRe: Passing Variable to Parent form Pin
natsuyaki11-May-08 23:18
natsuyaki11-May-08 23:18 
GeneralRe: Passing Variable to Parent form Pin
Christian Graus11-May-08 23:20
protectorChristian Graus11-May-08 23:20 
GeneralRe: Passing Variable to Parent form Pin
natsuyaki11-May-08 23:27
natsuyaki11-May-08 23:27 
GeneralRe: Passing Variable to Parent form Pin
Christian Graus11-May-08 23:46
protectorChristian Graus11-May-08 23:46 
GeneralRe: Passing Variable to Parent form Pin
Colin Angus Mackay12-May-08 0:27
Colin Angus Mackay12-May-08 0:27 
GeneralRe: Passing Variable to Parent form Pin
natsuyaki11-May-08 23:35
natsuyaki11-May-08 23:35 
GeneralRe: Passing Variable to Parent form Pin
benjamin yap11-May-08 23:41
benjamin yap11-May-08 23:41 
GeneralRe: Passing Variable to Parent form Pin
natsuyaki11-May-08 23:47
natsuyaki11-May-08 23:47 
GeneralRe: Passing Variable to Parent form Pin
Christian Graus11-May-08 23:55
protectorChristian Graus11-May-08 23:55 
AnswerRe: Passing Variable to Parent form Pin
MoustafaS12-May-08 2:34
MoustafaS12-May-08 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.