To begin, the code sets the filename and then clears it.
Anyway, try this, though I'm not too sure what you are trying to do.
The code is very well commented.
private static void materialFlatButton4_Click_1(object sender, EventArgs e)
{
// Prompt user to open file
OpenFileDialog open =...