I created a user control with a label and 2 combo boxes, and a public property called ControlDataSource that accepts a dataset - which it populates the combo boxes with. I added the reference to the VB project I want to use it on and to the toolbox. I was able to draw it on the form with no problem and use it. However, after changing the backcolor on the control and recompiling it, it is no longer seen by the form. When I bring up the form it's used on, I get a white screen with a bunch of xml. The problem seems to be in the designer, and I get an "object reference not set to an instance of an object" error. Here is the code from the designer:
-
'
-
'UcDx1
-
'
-
Me.UcDx1.AutoSize = True
-
Me.UcDx1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
-
Me.UcDx1.BackColor = System.Drawing.Color.Transparent
-
Me.UcDx1.ControlDataSource = Nothing
-
Me.UcDx1.LabelText = "Diag 1"
-
Me.UcDx1.Location = New System.Drawing.Point(1, 259)
-
Me.UcDx1.Margin = New System.Windows.Forms.Padding(0)
-
Me.UcDx1.Name = "UcDx1"
-
Me.UcDx1.SelectectedItemValue = ""
-
Me.UcDx1.Size = New System.Drawing.Size(289, 29)
-
Me.UcDx1.TabIndex = 3
-
-
The reference error is pointing to the line:
-
Me.UcDx1.ControlDataSource = Nothing
-
-
Here's the wierd part. If I hover the cursor over that property, it correctly identifies it as a dataset. So it does know what it is, but it can't seem to use it.
Any ideas would be appreciated.