2010-08-17 7 views
6

이것은 나의 문제입니다. 파일 열기 대화 상자를 여는 응용 프로그램이 있는데 "파일 이름 :"콤보 상자 섹션에 파일 경로와 파일 이름을 입력하려고합니다.화이트 - 파일 열기 대화 상자

응용 프로그램이 로그인 할 때 양식이로드됩니다. 그러면 여러 개의 단추가있는 다른 양식이 열립니다. 이 단추 중 하나를 선택하면 다른 양식이 열립니다. 이 형식으로 파일을 선택하는 버튼이 있습니다. 이 단계에서 3 개의 양식이 열립니다. 표준 파일 열기 대화 상자가 열립니다. 이 파일 열기 대화 상자에서 핸들을 가져올 수 없습니다.

다음은 내가 사용하고있는 코드입니다.

Window LoginForm = application.GetWindow("LoginForm"); 
LoginForm.Get<Button>("btnSelectFiles").Click(); // This is from the 3rd form that is opened 

어떤 이유로 든 LoginForm 변수를 사용하여 다른 양식의 모든 버튼에 액세스 할 수 있습니다. 나는 다음을 시도했다.

Window FileOpenDialog = application.GetWindow("Open", InitializeOption.NoCache); 

이것은 작동하지 않습니다.

다음도 시도했지만 null을 반환합니다. LoginForm 변수를 사용하여 액세스 할 수있을 것이라고 생각했습니다.

Win32ComboBox comboBox = LoginForm.Get<Win32ComboBox>("Filename"); 

아이디어가 있으십니까? 감사합니다

답변

5

열린 파일 대화 상자는 모달 창입니다. LoginForm.ModalWindows() 기능을 사용해야합니다. white project wiki :

Window mainWindow = application.GetWindow("main"); 
List<Window> modalWindows = mainWindow.ModalWindows(); //list of all the modal windows belong to the window. 
Window childWindow = mainWindow.ModalWindow("child"); //modal window with title "child" 
childWindow.IsModal; //returns true 
관련 문제