private void btnSelectPrivateKey_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Private Key Files|*.*"; openFileDialog.Title = "Select a Private Key File"; if (openFileDialog.ShowDialog() == DialogResult.OK) { tbPrivateKeyFilePath.Text = openFileDialog.FileName; if (mPenCommV2.SetPrivateKey(PrivateKeyFileReader.GetPrivateKeyFromFile(openFileDialog.FileName))) { MessageBox.Show("The private key has been set"); } else { MessageBox.Show("Private key failed to set"); } } }