prevent error when clicking on control buttons
This commit is contained in:
@@ -7,10 +7,10 @@ Imports DigitalData.Controls.RegexEditor
|
||||
Imports DigitalData.Modules.Windows.Window
|
||||
|
||||
Public Class ctrlApplicationAssignment
|
||||
Public SelectedProfileId As Integer = 0
|
||||
Public SelectedProcessId As Integer = 0
|
||||
Public SelectedWindowId As Integer = 0
|
||||
Public SelectedControlId As Integer = 0
|
||||
Public Property SelectedProfileId As Integer = 0
|
||||
Public Property SelectedProcessId As Integer = 0
|
||||
Public Property SelectedWindowId As Integer = 0
|
||||
Public Property SelectedControlId As Integer = 0
|
||||
|
||||
Private Sub ctrlApplicationAssignment_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
TBCW_PROFILE_PROCESSTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
@@ -352,6 +352,7 @@ Public Class ctrlApplicationAssignment
|
||||
MyDataset.TBCW_PROF_REL_WINDOW.Clear()
|
||||
|
||||
If e.FocusedRowHandle < 0 Then
|
||||
SelectedProcessId = 0
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -377,17 +378,18 @@ Public Class ctrlApplicationAssignment
|
||||
Private Sub GridView_Window_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridView_Window.FocusedRowChanged
|
||||
Try
|
||||
If e.FocusedRowHandle < 0 Then
|
||||
SelectedWindowId = 0
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oSelectedRow As DataRow = GridView_Window.GetDataRow(e.FocusedRowHandle)
|
||||
Dim oWindowId As String = oSelectedRow.Item("GUID")
|
||||
|
||||
SelectedWindowId = oWindowId
|
||||
|
||||
If Control_Load() = False Then
|
||||
MsgBox($"Error while loading controls for window {oWindowId}", vbCritical, "")
|
||||
End If
|
||||
|
||||
SelectedWindowId = oWindowId
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
@@ -395,7 +397,7 @@ Public Class ctrlApplicationAssignment
|
||||
|
||||
Private Sub GridView_Control_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridView_Control.FocusedRowChanged
|
||||
If e.FocusedRowHandle < 0 Then
|
||||
SelectedControlId = Nothing
|
||||
SelectedControlId = 0
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user