c# - Refresh ScintillaNet TextPanel with path and line number as parameter -


i need in updating controls of scintillanet text panel.

note: code used demo app of scintillanet.

codeeditor[childclass]

 public codeeditor(tabpagex tabpagetocontrol, string path, int pos)     {         messagebox.show("code editor ctor");         m_ccurrenttabpage = tabpagetocontrol;         m_path = path;         m_linepos = pos;          initializecomponent();     }      scintillanet.scintilla textarea;      private void codeeditor_load(object sender, eventargs e)     {         messagebox.show("code editor load");         //create control         textarea = new scintillanet.scintilla();         textpanel.controls.add(textarea);          //config         textarea.dock = system.windows.forms.dockstyle.fill;         textarea.textchanged += (this.ontextchanged);          //view config         textarea.wrapmode = wrapmode.none;         textarea.indentationguides = indentview.lookboth;          //style         initcolors();         initsyntaxcoloring();         textarea.caretforecolor = color.white;          loaddatafromfile(m_path, m_linepos);          //number margin         initnumbermargin();      }     public void loaddatafromfile(string path, int pos)         {             if (file.exists(path))             {                  textarea.text = file.readalltext(path);                 textarea.invalidate();                 textarea.refresh();                  //set every line "0" start position                 textarea.linescroll(pos, 0);                 textarea.focus();             }         } 

tracefilter [parentform] snippet

int nt = convert.toint32(slineno);                                                              form fc = application.openforms["codeeditor"]; codeeditor codedlg = new codeeditor((tabpagex)tabcontrol.selectedtab, completepath, nt); var bexists = openedpath.exists(x => x.equals(completepath)); if (!bexists) {    openedpath.add(completepath);    if (fc == null)    {      codedlg.show();    }    else    {       codedlg.loaddatafromfile(completepath, nt);       codedlg.invalidate();       codedlg.refresh();     }  } 

currently when pass path , line number, , call codedlg.show(), displays source file line number. when pass path , line, text panel still stays on previous source file , line number. can't figure out how update control, have called refresh() , other methods updating controls doesn't seem help.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -