Skip to content

Commit

Permalink
ADDED: functionality to the open file in the menu tab
Browse files Browse the repository at this point in the history
  • Loading branch information
FredTheNoob committed Aug 9, 2019
1 parent dcb5216 commit 754ab0f
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 30 deletions.
174 changes: 144 additions & 30 deletions CodeEditor/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions CodeEditor/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace CodeEditor
{
Expand All @@ -16,5 +17,21 @@ public Form1()
{
InitializeComponent();
}

private void OpenFileToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog file = new OpenFileDialog();
file.Title = "Select A File To Open - Ensure You Match The Formats Supported";
file.Filter = "C# files|*.csproj;*.cs|VB.net|*.vb|HTML|*.html|XML|*.xml|SQL|*.sql|PHP|*.php|JavaScript Files|*.js|Lua Files|*.lua";
file.ShowDialog();

try
{
StreamReader streamReader = new StreamReader(file.FileName);
fastColoredTextBox1.Text = streamReader.ReadToEnd();
streamReader.Close();
}
catch {}
}
}
}

0 comments on commit 754ab0f

Please sign in to comment.