on 12-06-2011 9:00 PM
When making a functionally attachment in my Add-on, sometimes using the property of the OpenFileDialog C #, the dialog box that appears to select files is behind the screen of the sap. That is, it loses focus. How to do this by setting it as the main focus in sap? Here my code:
ThreadStart starter = delegate { Anexar(oEditItem); };
Thread t = new Thread(starter);
t.SetApartmentState(ApartmentState.STA);
t.Start();
t.Join();
public void Anexar(SAPbouiCOM.EditText oEditItem)
{
try
{
OpenFileDialog fDialog = new OpenFileDialog();
fDialog.Title = "Anexar arquivo";
fDialog.Filter = "(.)|.";
fDialog.InitialDirectory = @"C:\";
if (fDialog.ShowDialog() == DialogResult.OK)
{
oEditItem.Value = fDialog.FileName.ToString();
}
}
catch (Exception e)
{
SBO_Application.MessageBox(e.Message);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.