Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16013

[RESOLVED] Combobox Multiple Conditions

$
0
0
Hi All,

Could someone please tell me where I am going wrong with this? I have tried a few different scenarios of which none are working. The only value when selected that works is the first one "Winding". I need the YESNoCancel message to show up ONLY if none of these 3 selections have been chosen in the combobox. I have tried "If Not....Or If Not...Or If Not" , "If Not...If Not...If Not" , "If Not...OrElse...OrElse"


Code:

If Not CmbProcess.SelectedItem = "Winding" Or CmbProcess.SelectedItem = "Gap Seal" Or CmbProcess.SelectedItem = "Bonding" Then
Dim result As DialogResult = MessageBox.Show("  Did this part FAIL?", "", MessageBoxButtons.YesNoCancel)
            If result = DialogResult.Cancel Then
                testResults = "Cancelled"
                Exit Sub
            ElseIf result = DialogResult.No Then
                testResults = "Pass"
                rButton = Panel1.Controls.OfType(Of RadioButton).FirstOrDefault(Function(r) r.Checked = True)
                BtnDrop.PerformClick()
            ElseIf result = DialogResult.Yes Then
                Me.Height = 160
                Me.Top = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - Me.Height * 1.6
                testResults = "Fail"
            End If
        End If


Viewing all articles
Browse latest Browse all 16013

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>