How is it possible for my main form not to exist????

Johnson

Well-known member
Joined
Mar 6, 2009
Messages
158
Programming Experience
Beginner
Error 5 Name 'ClientForm' is not declared.

The form clearly exists. If i add a new form to the project it will appear in the context menu that appears when typing IE Form1.show will work

so must be some setting i changed? but im clueles to what. The name to indicate the project is BalloonHelp but that also dont work :(

25702576.jpg
 
Did you build this form in this designer/project? Did you add it to the project? Can you open the designer/code for this class? When you look at the properties what does it say in the build action?
 
Did you build this form in this designer/project? Did you add it to the project? Can you open the designer/code for this class? When you look at the properties what does it say in the build action?

Hello. sorry for late reply have been ill. The original base for this project was downloaded from a web site in c# that i converted to vb.net. but i assume it was built and not added.

I can view the designer code.

clientform.vb is compiled
clientform.designer is compile
clientform.resx is embedded resource

i changed the last one to compile and it let me type ClientForm.txtFilePath.Text = Dir but then 106 errors appeared

I would just like to point out clientform.vb in the names property is balloon help :S strnage
 
clientform.resx is embedded resource <- this is supposed to be set this way. Wished I could help you more, hopefully one of the guru's will chime in.
 
One of the thing's I've been waiting for was the common sense of posting the code where the error occurs, which has yet to be done. Telling us that "Error 5 Name 'ClientForm' is not declared. " doesn't mean a whole lot when there's no code posted for us to see.

Also I should point out that the name of the *.vb file doesn't necessarily mean that's the name of the form/class. It might be that the form name got changed but the project properties and the file name didn't get updated.
 
One of the thing's I've been waiting for was the common sense of posting the code where the error occurs, which has yet to be done. Telling us that "Error 5 Name 'ClientForm' is not declared. " doesn't mean a whole lot when there's no code posted for us to see.


Sorry. Right. Basically my app is a image host. I made a single instance app if a user clicks a image file to auto host it.

Application events.vb code

VB.NET:
Imports System.Windows.Forms
Imports Microsoft.VisualBasic.Devices
Imports Microsoft.VisualBasic.ApplicationServices
Imports System



Namespace My

    Class MyApplication

        'StartupNextInstance: Raised when launching a single-instance 
        'application and the application is already active. 

        Private Sub MyApplication_StartupNextInstance(ByVal sender As Object, _
              ByVal e As StartupNextInstanceEventArgs) _
              Handles Me.StartupNextInstance
            e.BringToForeground = True
            MainForm.Visible = True
            MainForm.WindowState = FormWindowState.Normal
            MainForm.BringToFront()
            MainForm.Activate()
            Application.DoEvents()
            For Each arg As String In e.CommandLine
                'Process the commandline args
                Dim Dir As String = arg
                ClientForm.txtFilePath.Text = Dir
                ClientForm.UploadPicture()
            Next
        End Sub
    End Class

End Namespace

I cant manage to fill my mainforms txtbox with a value then call my upload function

I always used in the past FormName.TexboxName = value
 
So it's erroring on these lines:
VB.NET:
For Each arg As String In e.CommandLine
    'Process the commandline args
    Dim Dir As String = arg
    [B][COLOR="Red"]ClientForm.txtFilePath.Text = Dir[/COLOR][/B]
    [B][COLOR="Red"]ClientForm.UploadPicture()[/COLOR][/B]
Next
?

If so then that explains it all, there's no instance of the form at that point and you'll need to create one before referencing it.
 
Hello.

Sorry but that means nothing to me. I am very new. Can you link me to a tutorial or something for me to read so i can learn this
 
There is no problems referring to the default form instance in the Startup events. If the error says ClientForm type doesn't exist it is because the form class name is not ClientForm or belongs to a different namespace. Have a look at the code in the ClientForm.vb file to see what is what.
 
Hello John. I just looked in the code and it had changed its name to balloonhelp

I rechanged it to

VB.NET:
   Partial Public Class ClientForm

ClientForm.txt bla bla now shows in the main form insatnce./ Obviously i would not need this.

I dont know where else to look to see if its class has changed name.

Application events still cant recognise ClientForm

any more ideas :(

edit: i dont know if this is any help

if i use this code to create a ballon tip

Dim ttpButton As New BalloonHelp

it actually creates a new instance of my app
 
Last edited:
Back
Top