Hello All,
I'm trying to add items to a ComboBox at Run-Time. I have the following code in the ClassLibrary;
and I call this from another Form using;Code:Public Class Diameters Public Function Diameter(ByRef ComboBox5 As System.Windows.Forms.ComboBox) As String ComboBox5.Items.Add("300mm") ComboBox5.Items.Add("350mm") ComboBox5.Items.Add("400mm") ComboBox5.Items.Add("450mm") ComboBox5.Items.Add("500mm") ComboBox5.Items.Add("560mm") ComboBox5.Items.Add("630mm") End Function End Class
The problem I have is an error Name 'ComboBox5' is not declared on ComboBox5 in this last piece of code.Code:Dim AddDia As String AddDia = EconoAxialFan.Diameters.Diameter(ComboBox5)
Now I have used the same method to call this as I have used in other parts of my program without any problems, so why this should now happen beats me.
Best Rgds,
Tarablue




Reply With Quote