error: name 'msgbox not declaired'
error: name 'msgbox not declaired'
Hi guys
I am using vb.net in visual studio 2005
Last night everything was going good in my code, this morning when i arrived to work and compiled my application i get error messages for all built in functions in my error window. I checked and the windows.forms reference is there and added.
error: msgbox not declared
error: inputbox not declared
I copied the error codes into Google and nothing come up and I never changed anything.
Regards
Gerald
I am using vb.net in visual studio 2005
Last night everything was going good in my code, this morning when i arrived to work and compiled my application i get error messages for all built in functions in my error window. I checked and the windows.forms reference is there and added.
error: msgbox not declared
error: inputbox not declared
I copied the error codes into Google and nothing come up and I never changed anything.
Regards
Gerald
-
- Registered User
- Posts: 2701
- Joined: 17 Aug 2004, 02:00
- Location: What? You mean you can't see me?
- Contact:
Re: error: name 'msgbox not declaired'
Well, we're probably going to need snippets of the code in question to help you with the matter.
If I can't find a friendship problem...I'll make a friendship problem!
http://www.youtube.com/watch?v=Lxo1qlk6gEI
http://www.youtube.com/watch?v=Lxo1qlk6gEI
- Ron2K
- Forum Technical Administrator
- Posts: 9050
- Joined: 04 Jul 2006, 16:45
- Location: Upper Hutt, New Zealand
- Contact:
Re: error: name 'msgbox not declaired'
.NET doesn't have classes called "msgbox" or "inputbox". Either you're referring to the MessageBox and TextBox classes (both in System.Windows.Forms), or you're missing a reference to whatever custom code defines them.
EDIT: Hang on - are those class names, or variable names? If they're variable names, you haven't declared your variables.
EDIT: Hang on - are those class names, or variable names? If they're variable names, you haven't declared your variables.
Kia kaha, Kia māia, Kia manawanui.
Re: error: name 'msgbox not declaired'
Hi
Sorry it's visual basic 2005. Ill post some of the code when i get back to work.
It gives me errors for every inputbox, msgbox and for example my code would look like this.
This is my home pc which works ok, the software on my work pc somehow is giving me the errors
Sorry it's visual basic 2005. Ill post some of the code when i get back to work.
It gives me errors for every inputbox, msgbox and for example my code would look like this.
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If txtclient.text = "" Then
MsgBox("Please enter in the clients name", MsgBoxStyle.Information)
End If
End Sub
-
- Registered User
- Posts: 14085
- Joined: 06 Oct 2004, 02:00
- Location: Location, Location...
- Contact:
Re: error: name 'msgbox not declaired'
did you include the relevant libraries? (C# uses libraries so I'm assuming VB does too)
-
- Registered User
- Posts: 26022
- Joined: 13 May 2004, 02:00
- Location: Getting there...
- Contact:
Re: error: name 'msgbox not declaired'
*deleted - supposed to be the Afrikaans thread...
MOOD - Thirsty
A surprising amount of modern pseudoscience is coming out of the environmental sector. Perhaps it should not be so surprising given that environmentalism is political rather than scientific.
Timothy Casey
A surprising amount of modern pseudoscience is coming out of the environmental sector. Perhaps it should not be so surprising given that environmentalism is political rather than scientific.
Timothy Casey
Re: error: name 'msgbox not declaired'
I'm here at work and here is a piece of code snippet.
In visual basic you don't include the relevant libraries, but i have imports the system.windows.forms name space and also added the reference by right clicking the project name and "add reference"
even this "Space" class has suddenly given me error: "space not declaired" and was working fine until i don't know what happend.
Code: Select all
'creates the details.txt file
Dim tw As TextWriter
tw = File.CreateText(Path & Client & "\" & "Details.txt")
If File.Exists(Path & Client & "\" & "Details.txt") Then
tw.WriteLine("Contact No1:" & Space(2) & ContactNo1)
tw.WriteLine("Contact No2:" & Space(2) & ContactNo2)
tw.WriteLine("Fax No:" & Space(2) & FaxNo)
tw.WriteLine("Address:" & Space(2) & Address)
tw.WriteLine("PO Box:" & Space(2) & POBox)
tw.Flush()
tw.Close()
End If
even this "Space" class has suddenly given me error: "space not declaired" and was working fine until i don't know what happend.
Re: error: name 'msgbox not declaired'
afaik vb.net uses
MessageBox.Show("Whatever message you want to show")
I think you are missing basic references.
Does your code say Imports System.Windows... anywhere at the top before the Class declaration?
Edit: Meh, I reread your post. Idk. Something is out of whack with your code.
MessageBox.Show("Whatever message you want to show")
Code: Select all
tw.WriteLine("Contact No1:" & Space(2) & ContactNo1)
Does your code say Imports System.Windows... anywhere at the top before the Class declaration?
Edit: Meh, I reread your post. Idk. Something is out of whack with your code.
а плечьми буйство струйка. Дверь Твоем юдоли. Виновником неразлучен страшиться невинность милосердье сладчайший. Век под вне Оно Нет сия тук. Все вас совоздыхая устремится ком мню возблеснув разверзают лик мой сопрягаешь. Неправды но Ту светлеет Неправых Ни ум смотреть.
Re: error: name 'msgbox not declaired'
Hi
Yes i have did imports system.windows.forms at the top.
Here is another piece of the code, as i said it was working fine until i came to work the next morning and just never compiled.
then again this msgbox is giving me an error. I don't know maybe i just should check my last backup on the visual studio and see what happens, but haven't backed up in a while:(
Yes i have did imports system.windows.forms at the top.
Here is another piece of the code, as i said it was working fine until i came to work the next morning and just never compiled.
Code: Select all
Try
'clears the listview before adding all the items
Me.ListView1.Clear()
' adding all the clients to the list view
Dim di As DirectoryInfo
di = New DirectoryInfo("\\192.168.0.1\share josam\josam client profile\" & Me.TreeView1.SelectedNode.Text)
For Each subdi As DirectoryInfo In di.GetDirectories
Me.ListView1.Items.Add(subdi.Name, 0)
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
Re: error: name 'msgbox not declaired'
Code: Select all
MessageBox.Show("Whatever message you want to show")
а плечьми буйство струйка. Дверь Твоем юдоли. Виновником неразлучен страшиться невинность милосердье сладчайший. Век под вне Оно Нет сия тук. Все вас совоздыхая устремится ком мню возблеснув разверзают лик мой сопрягаешь. Неправды но Ту светлеет Неправых Ни ум смотреть.
-
- Registered User
- Posts: 716
- Joined: 08 Oct 2004, 02:00
- Contact:
Re: error: name 'msgbox not declaired'
MsgBox still works in VB.NET 3.5. There is no MsgBox in C# though (there you have to use MessageBox.Show()).
Re: error: name 'msgbox not declaired'
Have you by any chance had VB6 installed on your home PC?
Try downloading the VB6 run times and install them then try again.
Or change the code so it uses Messagebox instead of Msgbox.
Something must be missing.
Try downloading the VB6 run times and install them then try again.
Or change the code so it uses Messagebox instead of Msgbox.
Something must be missing.
Re: error: name 'msgbox not declaired'
Thanks for the replies, I went back to check all my added references and i added "microsoft.visualbasic" I suppose that reference is for using vb6 style classes.
Im changing all my msgboxes to MessageBoxes, but im not sure on how to use inputbox, what does vb.net use instead on inputbox
Thanks again
Regards
Gerald
Im changing all my msgboxes to MessageBoxes, but im not sure on how to use inputbox, what does vb.net use instead on inputbox
Thanks again
Regards
Gerald