Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: .NET interfaces - why doesn't this work? Pin
Nick Parker8-Mar-04 17:57
protectorNick Parker8-Mar-04 17:57 
Generalloop error Pin
ASGill7-Mar-04 16:42
ASGill7-Mar-04 16:42 
GeneralRe: loop error Pin
Judah Gabriel Himango7-Mar-04 16:51
sponsorJudah Gabriel Himango7-Mar-04 16:51 
GeneralRe: loop error Pin
ASGill7-Mar-04 18:06
ASGill7-Mar-04 18:06 
GeneralRe: loop error Pin
Judah Gabriel Himango7-Mar-04 18:51
sponsorJudah Gabriel Himango7-Mar-04 18:51 
GeneralRe: loop error Pin
Dave Kreskowiak8-Mar-04 3:01
mveDave Kreskowiak8-Mar-04 3:01 
GeneralRe: loop error Pin
ASGill8-Mar-04 3:15
ASGill8-Mar-04 3:15 
GeneralRe: loop error Pin
Dave Kreskowiak8-Mar-04 8:08
mveDave Kreskowiak8-Mar-04 8:08 
OK. The loop now runs but your references in your if statement are still screwed up. Use this instead:
bool FrmIsOpen = false; 

if (this.MdiChildren.Length > 0)
    for (int i=0; i < this.MdiChildren.Length; i++) 
    { 
        if (this.MdiChildren[i].GetType() == GetType(FrmPassword)) 
        { 
            FrmIsOpen = true; 
            break; 
        } 
    }
}
 
if (!FrmIsOpen) 
{ 
    FrmPassword r = new FrmPassword(); 
    r.MdiParent = this;
    r.Show(); 
}

The first bolded statement was changed because 'this.MDIParent' will always return null if 'this' is an MDIParent. This was changed to checking if the MDIChildren collection has anything in it. In the second bolded statement, the 'typeof()' reference was changed to 'GetType()'. If you have to, you could change this to 'Type.GetType()'. This should take care of your problem.


RageInTheMachine9532
GeneralReading from text file and spliting information into array Pin
lordjpg7-Mar-04 14:04
lordjpg7-Mar-04 14:04 
GeneralRe: Reading from text file and spliting information into array Pin
Matthew Hazlett7-Mar-04 16:34
Matthew Hazlett7-Mar-04 16:34 
QuestionJpeg 2000 and .NET (C# / VB.NET / C++.NET / J#) ???? Pin
gicio7-Mar-04 9:31
gicio7-Mar-04 9:31 
QuestionBITS (Background Intelligent Transfer Service) and .NET ???? Pin
gicio7-Mar-04 9:31
gicio7-Mar-04 9:31 
AnswerRe: BITS (Background Intelligent Transfer Service) and .NET ???? Pin
Nick Parker7-Mar-04 9:58
protectorNick Parker7-Mar-04 9:58 
AnswerRe: BITS (Background Intelligent Transfer Service) and .NET ???? Pin
Heath Stewart8-Mar-04 4:18
protectorHeath Stewart8-Mar-04 4:18 
QuestionBITS (Background Intelligent Transfer Service) and SSL and .NET ???? Pin
gicio7-Mar-04 9:30
gicio7-Mar-04 9:30 
GeneralSocket Connect Timeout Pin
brian44447-Mar-04 8:28
brian44447-Mar-04 8:28 
GeneralRe: Socket Connect Timeout Pin
Mazdak7-Mar-04 8:36
Mazdak7-Mar-04 8:36 
GeneralRe: Socket Connect Timeout Pin
brian44447-Mar-04 10:47
brian44447-Mar-04 10:47 
GeneralPasswordBox Pin
The Bug7-Mar-04 7:06
The Bug7-Mar-04 7:06 
GeneralRe: PasswordBox Pin
JockerSoft7-Mar-04 7:52
JockerSoft7-Mar-04 7:52 
GeneralRe: PasswordBox Pin
The Bug7-Mar-04 8:12
The Bug7-Mar-04 8:12 
GeneralRe: PasswordBox Pin
JockerSoft8-Mar-04 5:28
JockerSoft8-Mar-04 5:28 
GeneralRe: PasswordBox Pin
Mazdak7-Mar-04 8:15
Mazdak7-Mar-04 8:15 
GeneralRe: PasswordBox Pin
Nick Parker7-Mar-04 9:05
protectorNick Parker7-Mar-04 9:05 
GeneralRe: PasswordBox Pin
Heath Stewart8-Mar-04 3:59
protectorHeath Stewart8-Mar-04 3:59 

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.