private async void splitButtonExport_DropDowItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (e.ClickedItem.Text == "to Excel")
{
Task k = ExportToExcel();
await k;
}
}
private async Task ExportToExcel()
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.ShowDialog();
await Task.Run(() =>
{
if (saveFileDialog1.FileName != "")
{
var options = new ExcelExportingOptions();
var excelEngine = sfDataGrid1.ExportToExcel(sfDataGrid1.View, options);
var workBook = excelEngine.Excel.Workbooks[0];
workBook.SaveAs(saveFileDialog1.FileName);
}
});
}
This is my code.
This is the splitbutton I made.
I want the list to disappear when I select an item.
But it doesn't disappear like this.
It is above the windows of other programs..
How can I make the list disappear the moment the item is selected?
If this is not possible, I would like to be behind another program's window or savefiledialog window.
Help me plz~