diff --git a/app/DD_PM_WINDREAM/frmMassValidator.vb b/app/DD_PM_WINDREAM/frmMassValidator.vb index e827f4f..453c32b 100644 --- a/app/DD_PM_WINDREAM/frmMassValidator.vb +++ b/app/DD_PM_WINDREAM/frmMassValidator.vb @@ -273,17 +273,31 @@ Public Class frmMassValidator End If #End Region - Dim maxWith As Integer = cmb.Width - Using g As Graphics = Me.CreateGraphics - For Each oItem As Object In cmb.Items 'Für alle Einträge... - Dim g1 As Graphics = cmb.CreateGraphics - If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then - maxWith = g1.MeasureString(Text, cmb.Font).Width + 30 - End If - g1.Dispose() - Next oItem - End Using - cmb.DropDownWidth = maxWith + 'Dim oMaxWidth As Integer = cmb.Width + + 'Using oGraphics As Graphics = cmb.CreateGraphics() + ' Dim oStringLength = oGraphics.MeasureString(Text, cmb.Font).Width + ' If oStringLength + 30 > oMaxWidth Then + ' oMaxWidth = oStringLength + 30 + ' End If + 'End Using + + 'Using g As Graphics = Me.CreateGraphics + ' For Each oItem As Object In cmb.Items 'Für alle Einträge... + ' Dim g1 As Graphics = cmb.CreateGraphics + ' If g1.MeasureString(Text, cmb.Font).Width + 30 > oMaxWidth Then + ' oMaxWidth = g1.MeasureString(Text, cmb.Font).Width + 30 + ' End If + ' g1.Dispose() + ' Next oItem + 'End Using + + 'cmb.DropDownWidth = oMaxWidth + + + + + oControl = cmb End If diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index 9b8f8da..84c4214 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -906,17 +906,26 @@ Public Class frmValidator #End Region - Dim maxWith As Integer = oComboBox.Width - Using g As Graphics = Me.CreateGraphics - For Each oItem As Object In oComboBox.Items 'Für alle Einträge... - Dim g1 As Graphics = oComboBox.CreateGraphics - If g1.MeasureString(Text, oComboBox.Font).Width + 30 > maxWith Then - maxWith = g1.MeasureString(Text, oComboBox.Font).Width + 30 - End If - g1.Dispose() - Next oItem - End Using - oComboBox.DropDownWidth = maxWith + 'Dim oMaxWidth As Integer = oComboBox.Width + + 'Using oGraphics As Graphics = oComboBox.CreateGraphics() + ' Dim oStringLength = oGraphics.MeasureString(Text, oComboBox.Font).Width + ' If oStringLength + 30 > oMaxWidth Then + ' oMaxWidth = oStringLength + 30 + ' End If + 'End Using + + 'Using g As Graphics = Me.CreateGraphics + ' For Each oItem As Object In oComboBox.Items 'Für alle Einträge... + ' Dim g1 As Graphics = oComboBox.CreateGraphics + ' If g1.MeasureString(Text, oComboBox.Font).Width + 30 > oMaxWidth Then + ' oMaxWidth = g1.MeasureString(Text, oComboBox.Font).Width + 30 + ' End If + ' g1.Dispose() + ' Next oItem + 'End Using + + 'oComboBox.DropDownWidth = oMaxWidth oMyControl = oComboBox End If @@ -2269,17 +2278,28 @@ Public Class frmValidator cmbpanel.DisplayMember = resultDT.Columns(0).ColumnName cmbpanel.ValueMember = resultDT.Columns(0).ColumnName - Dim maxWith As Integer = cmbpanel.Width - Using g As Graphics = Me.CreateGraphics - For Each oItem As Object In cmbpanel.Items 'Für alle Einträge... - Dim g1 As Graphics = cmbpanel.CreateGraphics - If g1.MeasureString(Text, cmbpanel.Font).Width + 30 > maxWith Then - maxWith = g1.MeasureString(Text, cmbpanel.Font).Width + 30 - End If - g1.Dispose() - Next oItem - End Using - cmbpanel.DropDownWidth = maxWith + + + 'Dim oMaxWidth As Integer = cmbpanel.Width + + 'Using oGraphics As Graphics = cmbpanel.CreateGraphics() + ' Dim oStringLength = oGraphics.MeasureString(Text, cmbpanel.Font).Width + ' If oStringLength + 30 > oMaxWidth Then + ' oMaxWidth = oStringLength + 30 + ' End If + 'End Using + + 'Using g As Graphics = Me.CreateGraphics + ' For Each oItem As Object In cmbpanel.Items 'Für alle Einträge... + ' Dim g1 As Graphics = cmbpanel.CreateGraphics + ' If g1.MeasureString(Text, cmbpanel.Font).Width + 30 > oMaxWidth Then + ' oMaxWidth = g1.MeasureString(Text, cmbpanel.Font).Width + 30 + ' End If + ' g1.Dispose() + ' Next oItem + 'End Using + + 'cmbpanel.DropDownWidth = oMaxWidth ElseIf displayboxname.StartsWith(ClassControlCreator.PREFIX_LOOKUP) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_TABLE) Then LOGGER.Warn("Depending_Control_Set_Result PREFIX_LOOKUP NOT IMPLEMENTED")