コード例 #1
0
ファイル: MainForm.cs プロジェクト: yanshi7890/CsvEditor
 /// <summary>
 /// 打开转到窗口
 /// </summary>
 private void OnGotoEditToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!SelCsvFormInitialized())
     {
         return;
     }
     if (m_GotoForm == null || m_GotoForm.IsDisposed)
     {
         m_GotoForm = new GotoForm();
     }
     if (!m_GotoForm.Visible)
     {
         m_GotoForm.Show();
     }
 }
コード例 #2
0
        private void goToLocationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GotoForm form = new GotoForm();

            if (tabBar.CurrentTab.ColumnView.LastColumn is DirectoryColumn)
            {
                form.ItemsPath = tabBar.CurrentTab.ColumnView.LastColumn.ItemsPath;
            }
            form.Left = this.Left + this.Width / 2 - form.Width / 2;
            form.Top  = this.Top + this.Height / 4 - form.Height / 4;
            form.Show();

            form.AcceptButtonClicked += (_, evt) => {
                tabBar.CurrentTab.ColumnView.NavigateTo(new DirectoryColumn(form.ItemsPath, this));
                tabBar.CurrentTab.ColumnView.Columns[0].Focus();
                tabBar.CurrentTab.ColumnView.ScrollToLastColumn();
            };
        }