Click here to Skip to main content
       

C#

 
GeneralRe: programe PinmemberSoMad23-Feb-13 11:46 
AnswerRe: programe PinprofessionalAmir Mohammad Nasrollahi29-Jul-13 21:45 
QuestionCustomize windows scroll bar in combobox PinmemberKaizen20223-Feb-13 7:45 
AnswerRe: Customize windows scroll bar in combobox PinmemberSledgeHammer0123-Feb-13 9:20 
GeneralRe: Customize windows scroll bar in combobox PinmemberKaizen20224-Feb-13 6:01 
GeneralRe: Customize windows scroll bar in combobox PinmemberSledgeHammer0124-Feb-13 8:20 
Questionunable to start program, unrecognized error in windows web services framework Pinmemberbonosa23-Feb-13 5:06 
Questionwhy System.NullReferenceException occurred? PinmemberJassim Rahma23-Feb-13 1:54 
Hi,
 
I am using the following code to activate existing MDI child and refresh the grid at the same time. It was working fine until today but suddenly I am getting:\
 
System.NullReferenceException occurred
Message=Object reference not set to an instance of an object.
Source=Cure
StackTrace:
at cure_hospital_management.frmMain.repositoryItemFindFile_KeyDown(Object sender, KeyEventArgs e) in C:\Users\DELL USER\Documents\Visual Studio 2010\Projects\Cure\Cure\main_form.cs:line 1718
InnerException:

 
here is the code:
 
if (e.KeyCode == Keys.Enter && (sender as TextEdit).Text.Trim() != "")
{
    this.Cursor = Cursors.WaitCursor;
 
    is_form_exists = false;
 
    foreach (Form search_resul_form in this.MdiChildren)
    {
        frmSearchResult search_form = search_resul_form as frmSearchResult;
 
        if ((string)search_form.Tag == "BROWSE_PATIENTS")
        {
            // search_form.Activated(null, null);
            search_form.find_what = "FILE";
            search_form.find_text1 = (sender as TextEdit).Text.Trim();
            search_form.find_text2 = null;
            search_form.browse_result();
            search_form.Activate();
            is_form_exists = true;
            break;
        }
    }
 
    if (is_form_exists == false)
    {
        frmSearchResult SearchResultForm = new frmSearchResult(public_var);
        SearchResultForm.Tag = "BROWSE_PATIENTS";
        SearchResultForm.MdiParent = this;
        SearchResultForm.Dock = DockStyle.Fill;
        SearchResultForm.find_what = "FILE";
        SearchResultForm.find_text1 = (sender as TextEdit).Text.Trim();
        SearchResultForm.find_text2 = null;
        SearchResultForm.Show();
    }
 
    (sender as TextEdit).Text = "";
 
    this.Cursor = Cursors.Default;
}

 
Technology News @ www.JassimRahma.com

AnswerRe: why System.NullReferenceException occurred? PinmemberAlan N23-Feb-13 2:04 
GeneralRe: why System.NullReferenceException occurred? PinmemberJassim Rahma23-Feb-13 2:10 
GeneralRe: why System.NullReferenceException occurred? PinmemberAlan N23-Feb-13 2:33 
GeneralRe: why System.NullReferenceException occurred? PinmemberJassim Rahma23-Feb-13 2:44 
GeneralRe: why System.NullReferenceException occurred? PinmemberAlan N23-Feb-13 2:54 
AnswerRe: why System.NullReferenceException occurred? Pinmemberjschell24-Feb-13 7:05 
QuestionHow to read gmail mails using C# (only Unread Email ) [modified] PingroupAeroIT22-Feb-13 18:13 
AnswerRe: How to read gmail mails using C# (only Unread Email ) PinmvpDave Kreskowiak22-Feb-13 18:22 
AnswerRe: How to read gmail mails using C# (only Unread Email ) PinmvpOriginalGriff22-Feb-13 21:42 
AnswerRe: How to read gmail mails using C# (only Unread Email ) PinmemberMarco Bertschi23-Feb-13 8:02 
AnswerRe: How to read gmail mails using C# (only Unread Email ) [modified] PinprofessionalAmir Mohammad Nasrollahi29-Jul-13 21:51 
Questionsimplest hacking software in C# PinmemberMember 985741522-Feb-13 16:44 
AnswerRe: simplest hacking software in C# PinmvpDave Kreskowiak22-Feb-13 18:21 
AnswerRe: simplest hacking software in C# PinmemberSoMad22-Feb-13 19:13 
AnswerRe: simplest hacking software in C# PinmvpOriginalGriff22-Feb-13 21:44 
GeneralRe: simplest hacking software in C# PinmemberJibesh22-Feb-13 22:46 
GeneralRe: simplest hacking software in C# PinmemberShubh Agrahari23-Feb-13 2:03 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 2 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid