From 5414e89189069fe7f9bef8850213abd479c5b591 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Thu, 2 Apr 2026 15:36:14 +0200 Subject: [PATCH] Update profile selection logic and cleanup comments Removed check preventing reload of selected profile in frmDIProfilEigenschaften.vb, always loading the chosen profile and updating _pos accordingly. Also cleaned up comments and formatting in frmNIProfileigenschaften.vb. --- ToolCollection/frmDIProfilEigenschaften.vb | 8 +++++--- ToolCollection/frmNIProfileigenschaften.vb | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ToolCollection/frmDIProfilEigenschaften.vb b/ToolCollection/frmDIProfilEigenschaften.vb index 0cf42fd..cbd79b9 100644 --- a/ToolCollection/frmDIProfilEigenschaften.vb +++ b/ToolCollection/frmDIProfilEigenschaften.vb @@ -237,9 +237,7 @@ Public Class frmDIProfilEigenschaften Private Sub cmbProfilauswahl_DropDownItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles cmbProfilauswahl.DropDownItemClicked - ' wenn bereits ein Profil ausgewählt wurde If Me.selectedProfile IsNot Nothing Then - ' wenn es sich bei dem ausgewählten Element um das gleiche handelt wie das Aktive, dann nichts tun If e.ClickedItem.Text = Me.selectedProfile.Profilname Then Exit Sub If selectedProfile.HasChanges Then @@ -251,7 +249,11 @@ Public Class frmDIProfilEigenschaften 'Dim changeProfile As Boolean = Me.AskToSaveIfNeccessary(False) Lade_Profil(e.ClickedItem.Text) - + For i = 0 To arrProfile.GetUpperBound(0) + If arrProfile(i, 0) = e.ClickedItem.Text Then + _pos = arrProfile(i, 1) + End If + Next End Sub diff --git a/ToolCollection/frmNIProfileigenschaften.vb b/ToolCollection/frmNIProfileigenschaften.vb index 7773d27..a58c2ec 100644 --- a/ToolCollection/frmNIProfileigenschaften.vb +++ b/ToolCollection/frmNIProfileigenschaften.vb @@ -522,7 +522,7 @@ Public Class frmNIProfileigenschaften Private Sub cmbProfilauswahl_DropDownItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles cmbProfilauswahl.DropDownItemClicked - ' wenn bereits ein Profil ausgewählt wurde + If Me._selectedProfile IsNot Nothing Then Me.cmbIndexValidierung.SelectedIndex = -1 If _selectedProfile.HasChanges Then