tools/Stampfer/PeterSource1_1/DockContent/ctrlGothicData.cs
/// <summary>
/// After an item is selected, scroll to it...
/// </summary>
/// <param name="sender">TreeView</param>
/// <param name="e">TreeViewEventArgs</param>
After an item is selected, scroll to it
After an item is selected scroll to it
void treeMain_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (this.tsbGotoCode.Checked)
            {
                if (this.m_CanScroll)
                {
                    if (e.Node.Parent != null)
                    {
                        if (e.Node.Tag != null)
                        {
                            int off = Convert.ToInt32(e.Node.Tag.ToString());
                            int index = e.Node.Text.IndexOf(":");
                            int temp = e.Node.Text.IndexOf("(");
                            if ((temp < index && temp > 0) || index == -1)
                            {
                                index = temp;
                            }
                            temp = e.Node.Text.IndexOf(" ");
                            if ((temp < index && temp > 0) || index == -1)
                            {
                                index = temp;
                            }
                            int pos;
                            if (index < 0)
                            {
                                pos = off + e.Node.Text.Length;
                            }
                            else
                            {
                                pos = off + index;
                            }
                            this.ScrollToOffset(off, pos);
                        }
                    }
                }
            }
        }
void treeMain_AfterSelect ( object sender , TreeViewEventArgs e ) { if ( this . tsbGotoCode . Checked ) { if ( this . m_CanScroll ) { if ( e . Node . Parent != null ) { if ( e . Node . Tag != null ) { int off = Convert . ToInt32 ( e . Node . Tag . ToString ( ) ) ; int index = e . Node . Text . IndexOf ( " " ) ; int temp = e . Node . Text . IndexOf ( " " ) ; if ( ( temp < index && temp > 0 ) || index == - 1 ) { index = temp ; } temp = e . Node . Text . IndexOf ( " " ) ; if ( ( temp < index && temp > 0 ) || index == - 1 ) { index = temp ; } int pos ; if ( index < 0 ) { pos = off + e . Node . Text . Length ; } else { pos = off + index ; } this . ScrollToOffset ( off , pos ) ; } } } } }
After an item is selected, scroll to it...
After an item is selected scroll to it ...
sender
object
None
e
TreeViewEventArgs
None