mirror of
https://github.com/abrendan/smolEdit.git
synced 2025-08-25 22:12:03 +02:00
removed the border around the text box and fixed the "Open With" function
This commit is contained in:
@@ -8,13 +8,19 @@ namespace V_EditorPro
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
public MainForm()
|
||||
public MainForm(string filePath = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.KeyPreview = true;
|
||||
this.KeyDown += new KeyEventHandler(MainForm_KeyDown);
|
||||
|
||||
if (!string.IsNullOrEmpty(filePath))
|
||||
{
|
||||
OpenFile(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void MainForm_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Control && e.KeyCode == Keys.O)
|
||||
@@ -53,6 +59,11 @@ namespace V_EditorPro
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenFile(string filePath)
|
||||
{
|
||||
richTextBox1.Text = File.ReadAllText(filePath);
|
||||
}
|
||||
|
||||
private void OpenFile()
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
@@ -60,7 +71,7 @@ namespace V_EditorPro
|
||||
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
richTextBox1.Text = File.ReadAllText(openFileDialog.FileName);
|
||||
OpenFile(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user