P
phillip_putzback
I created a custom control by and dragged a combobox on to the template
and then added the following code
Public Class dOOdadsOperandComboBox
Inherits System.Windows.Forms.ComboBox
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
operandComboBox.DataSource = operandComboBox.DataSource =
System.Enum.GetValues(GetType(Global.System.Windows.Forms.ColorDepth))
End Sub
End Class
Now on the form I added the control to it shows all the values listed
in the combobox and it works fine. But I added a button to test the
values and it gives me an error like the object doesn't exist.
MsgBox("Selected Value" &
Me.DOOdadsOperandComboBox1.SelectedValue.ToString)
MsgBox("Selected item " &
Me.DOOdadsOperandComboBox1.SelectedItem.ToString)
I don't even see the value that the combo box is displaying when
looking in the debug/locals window. I am expecting the msg to be
"Depth4bit" but I get an object reference not set to an instance of an
object exception.
Thanks
and then added the following code
Public Class dOOdadsOperandComboBox
Inherits System.Windows.Forms.ComboBox
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
operandComboBox.DataSource = operandComboBox.DataSource =
System.Enum.GetValues(GetType(Global.System.Windows.Forms.ColorDepth))
End Sub
End Class
Now on the form I added the control to it shows all the values listed
in the combobox and it works fine. But I added a button to test the
values and it gives me an error like the object doesn't exist.
MsgBox("Selected Value" &
Me.DOOdadsOperandComboBox1.SelectedValue.ToString)
MsgBox("Selected item " &
Me.DOOdadsOperandComboBox1.SelectedItem.ToString)
I don't even see the value that the combo box is displaying when
looking in the debug/locals window. I am expecting the msg to be
"Depth4bit" but I get an object reference not set to an instance of an
object exception.
Thanks