Skip to Content
author's profile photo Former Member
Former Member

DI 6.7 OpenDialog

Hi,

How can I open a dialog box to select a file?

I don´t know why, but using that code:

Dim od As OpenFileDialog

od = New OpenFileDialog

od.Filter = "Ficheiros de Importaçao (.txt)|.txt"

oDialogOpened = True

If od.ShowDialog = DialogResult.OK Then

SBO_Application.MessageBox(od.FileName)

End If

od = Nothing

always pass twice by the event and the window dialog doesn't come the active window, it stays in "background", I have to press ALT + TAB to show the dialog.

Thanks,

Ribeiro Santos

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jan 25, 2005 at 04:16 PM

    Hi Ribeiro,

    I´m not sure about 2004, but in 6.5 it was a known error.

    Have a look at an old message, that describe a solution for 6.5 . If someone knows if this issue has been fixed, will be good to know.

    API call for Common Dialog box

    Regards,

    Ibai Peñ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 27, 2005 at 03:35 PM

    Hi,

    I am using Vb.Net and B1 2004 with SDK 6.7

    With this code it works

    Dim frm As New Form

    Dim od As New OpenFileDialog

    frm.TopMost = True

    If od.ShowDialog(frm) Then

    SBO_Application.MessageBox(od.FileName)

    End If

    od = Nothing

    frm = Nothing

    Ribeiro Santos

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      This only masks the problem. The user is still not restricted to the SAP BO window. I had the same problem with FolderBrowserDialog and had to locate the BO window handle using FindWindow in the Win32 api. This can then be used to SetParent to BO.

      It would be nice to have a method within SAP BO to return the Win32Window object to pass to the Common dialogs as in ... dialog.ShowDialog(SAPWindowHandle).

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.