Below is my little console application that ask for name and display it in the message dialog box. Unfortunately there is a problem when I try to iimports System.Windows.Forms The error message is Warning 1 Namespace or type specified in the Imports 'System.Windows.Forms' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. I'm using Visual Basic 2008 express edition. any help would be appreciated.
Public Class Form1 Dim number(10) As String Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged TextBox1.Text = number(ComboBox1.Items.IndexOf(ComboBox1.Text)) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ComboBox1.Items.Add(ComboBox1.Text) number(ComboBox1.Items.IndexOf(ComboBox1.Text)) = TextBox1.Text End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.Items.Add("") : number(0) = "" End Sub End Class |
Please refer to MSDN.microsoft.com/en-us/library/system.windows.forms.aspx
0 comments:
Post a Comment