Tormenator1
Tormenator1
CC#
Created by Tormenator1 on 1/14/2024 in #help
Print statements not appearing in terminal of Eto application.
I'm using Eto to create a basic GUI,however,I'm running into an odd issue.
var clickMe = new Command { MenuText = "Open", ToolBarText = "Open" };
clickMe.Executed += (sender, e) =>
{
Console.WriteLine("Clickme activated");
var result = openFileDialog.ShowDialog(Application.Instance.MainForm);
if (result == DialogResult.Ok)
{
Console.WriteLine("OK pressed");
// Handle the selected file(s) here
var selectedFiles = openFileDialog.Filenames;
string pass = string.Join("",selectedFiles);
FileAnalyze.InitalProc(pass);
}
else{
Console.WriteLine("failstate");
}
};
var clickMe = new Command { MenuText = "Open", ToolBarText = "Open" };
clickMe.Executed += (sender, e) =>
{
Console.WriteLine("Clickme activated");
var result = openFileDialog.ShowDialog(Application.Instance.MainForm);
if (result == DialogResult.Ok)
{
Console.WriteLine("OK pressed");
// Handle the selected file(s) here
var selectedFiles = openFileDialog.Filenames;
string pass = string.Join("",selectedFiles);
FileAnalyze.InitalProc(pass);
}
else{
Console.WriteLine("failstate");
}
};
When I press the corresponding button and open the dialog,none of these print statements execute,and I'm unsure why.
1 replies
CC#
Created by Tormenator1 on 1/14/2024 in #help
✅ Utilizing the extension filter for openfiledialog
Hello. I'm attempting to use this
openFileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
openFileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
to filter for text files. However,I get an error that says 'OpenFileDialog' does not contain a definition for 'Filter' and no accessible extension method 'Filter' accepting a first argument of type 'OpenFileDialog' could be found (are you missing a using directive or an assembly reference?). I am on the newest version of the NET SDK,but I'm pretty sure that .Filter wasn't decapricated. What am i doing wrong?
2 replies