예제 #1
0
 private void 查找ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     FrmFind frm = new FrmFind();
     frm.Show(this);
 }
예제 #2
0
        private void lrcv_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control && e.KeyCode == Keys.A)
                this.lrcv.SelectAll();
            else if (e.Control && e.KeyCode == Keys.F)
            {
                FrmFind frm = new FrmFind();
                frm.Show(this);
            }
            else if (e.Alt && e.KeyCode == Keys.F)
            {
                switch (Gib.nowtab)
                {
                    case 1:
                        filev1.Focus();
                        break;
                    case 2:
                        filev2.Focus();
                        break;
                    case 3:
                        filev3.Focus();
                        break;
                }
            }
            else if (e.KeyCode == Keys.S)
            {
                if (e.Control)
                {
                    if (Gib.nowp[Gib.nowtab] > 0)
                        if (Gib.txtpath != "")
                        {
                            if (Path.GetExtension(Gib.txtpath).ToLower() == ".rtf")
                                lrcv.SaveFile(Gib.txtpath, RichTextBoxStreamType.RichText);
                            else if (Path.GetExtension(Gib.txtpath).ToLower() == ".lrc")
                                File.WriteAllText(Gib.txtpath, Gib.infile);
                            else if (Path.GetExtension(Gib.txtpath).ToLower() == ".txt")
                                File.WriteAllText(Gib.txtpath, Gib.infile, Encoding.GetEncoding("GB2312"));
                            else if (Path.GetExtension(Gib.txtpath).ToLower() != ".mp3")
                                File.WriteAllText(Gib.txtpath, Gib.infile, Encoding.Default);

                            Gib.backup = Gib.infile;
                            txtstate.Text = "未修改";
                        }
                }
                else if (e.Alt)
                    search_Click(sender, e);
            }
            else if (e.Control && e.KeyCode == Keys.D)
            {
                if (MessageBoxEx.Show("确定删除文件?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) ==
                    DialogResult.OK)
                {
                    delfd(Gib.txtpath, true);
                    reffile(Gib.fpos[Gib.nowtab, Gib.nowp[Gib.nowtab]]);
                }
            }
            else if (e.Control && e.KeyCode == Keys.C)
                try { Clipboard.SetDataObject(this.lrcv.SelectedRtf, true); }
                catch { }
        }