2016-06-15 3 views
0

DevExpress에서 프로그램을 작성하고 있는데 문제가 발생했습니다. 조건이 설정되면 하나의 타일을 표시하고 싶습니다.이 경우 특정 값을 입력하십시오. 사용자가 입력하면 원하는 창으로 이동합니다. 그렇지 않으면 주 양식으로 돌아 가야합니다.조건이 설정되지 않은 경우 MainForm으로 돌아갑니다.

조건이 설정되지 않은 경우 프로그램이 주 양식으로 이동하는 문제가 발생합니다. 시도 할 때마다 프로그램이 중단됩니다.

도와주세요. 감사! 내가 제대로 이해하면

Private Sub windowsUIView1_QueryControl(sender As Object, e As QueryControlEventArgs) Handles windowsUIView1.QueryControl 
    .... 
    ElseIf e.Document Is Document9 Then 
     Dim cuentaInicial = InputBox("Por favor introduzca la cuenta inicial del día", "Inicial") 

     If cuentaInicial = "" Then 
      MsgBox("Por favor introduzca un valor inicial", vbCritical, "Error") 
      Me.Refresh()' <-- Problem here 
      Exit Sub 
     End If 

     Try 
      Dim inicial As Double = Double.Parse(cuentaInicial) 
      e.Control = New Caja 
     Catch ex As Exception 
      MsgBox(cuentaInicial & ": No es el formato correcto. Favor de verificar", vbCritical, "Error") 
      Me.Refresh() '<-- problem here 
     End Try 
    End If 
End Sub 

답변

1

, 당신은 타일을 클릭에 대화 상자를 표시하고 싶습니다. 그렇다면 WindowsUIView.QueryControl 이벤트 (문서가 이미 표시되었을 때 발생) 대신 WindowsUIView.TileClick 이벤트를 처리하는 것이 좋습니다. WindowsUIView.TileClick 이벤트 핸들러 내에서

당신이 이벤트 인수에서 취급 속성을 설정을 통해 사용자가 해당 문서에 탐색 할 수 있는지 더 확인하실 수 있습니다

레벨 : 내가하려는 정확히 무엇 이었는가

Sub WindowsUIView1_TileClick(sender As Object, e As DevExpress.XtraBars.Docking2010.Views.WindowsUI.TileClickEventArgs) Handles WindowsUIView1.TileClick 
    ... 
    If e.Document Is Document9 Then 
     Dim cuentaInicial = InputBox("Por favor introduzca la cuenta inicial del día", "Inicial") 
     If cuentaInicial = "" Then 
      MsgBox("Por favor introduzca un valor inicial", vbCritical, "Error") 
      e.Handled = True ' !!!do not naviate into the document 
      Exit Sub 
     End If 
    ... 
    End If 
End Sub 
+0

및 그것은 매력처럼 일했습니다. 감사! –

관련 문제