Results 1 to 5 of 5

Thread: "Form Main"... eh?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Location
    Bracebridge
    Posts
    20

    Question "Form Main"... eh?

    OK - gotta question - can someone help?

    I have a program with two forms. One form is the startup form, and the other is accessed when I press a button. I get a build error, and it seems that I'm missing the words "form main" somewhere in the first form. Anyone know where I need to enter that?

    Ian

  2. #2
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    Dear Ian, probably because of my poor english, I can't understand which is the problem. Probably if it were happened to me, I could recognize it immediately, but I never saw that behaviour...so I must investigate to solve it.
    It's possible someone could recognize it and help you, but if it's not so, than post your code and, if possible, the exact text of the error message. The code you have to post, is not the entire application, obviously, but where Forms are declared and instanciated. Good job
    Live long and prosper (Mr. Spock)

  3. #3
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: "Form Main"... eh?

    Originally posted by Ian McKenzie
    OK - gotta question - can someone help?

    I have a program with two forms. One form is the startup form, and the other is accessed when I press a button. I get a build error, and it seems that I'm missing the words "form main" somewhere in the first form. Anyone know where I need to enter that?

    Ian
    I'll take a guess.

    Assume your forms are named fclsStartup and fclsMain

    in the button click event put

    Dim frmMain as new fclsMain
    frmMain.ShowDialog()


    Try it. Depending on what you are doing, this may need amending, but it should work OK.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Location
    Bracebridge
    Posts
    20

    "Form Main" file

    Thanks for the suggestion - it worked in a strange way... it caused me to look at what I had called the new form - I had changed the name of the form without altering the code. So my coding was fine except it referred to a nonexistent form.

    Doh!

    I'm really impressed and grateful that guys like you are out there.

    Thanks again.

    Ian

  5. #5
    Lively Member ayan's Avatar
    Join Date
    Jan 2004
    Posts
    112
    call it as the class... let us say you renam form2 to xxxform. the class still says
    VB Code:
    1. public class form1
    2. .
    3. .
    4. .
    5. end class
    you should still say
    VB Code:
    1. dim f as new form2() 'class name
    2. f.show

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width