Results 1 to 13 of 13

Thread: linking forms togther

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    oregon
    Posts
    88

    linking forms togther

    ALright, I need to know step by step how to link a button or anything to another forum. like when they click the " options " on the drop down menu it would open up frmoptions....so how do i do that step by step in .net?
    To get somthing out of life, you always need to be persistant.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Put this in the click event of the menu or button you need it in (or whereever)

    VB Code:
    1. dim frm as New frmOptions
    2. frm.ShowDialog()

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    oregon
    Posts
    88
    how do i define it? cuz its givin me a compile error.
    To get somthing out of life, you always need to be persistant.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Make sure that the form is really called frmOptions?

    On the form at the top where it says:

    Public Class Form1

    it should say:

    Public Class frmOptions

    If you change it then you will get an error in the autogenerated code too because there is one spot in there that you will need to change Form1 to frmOptions also. Or you could search and change it.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    oregon
    Posts
    88
    this is what it says..look at the pic..


    To get somthing out of life, you always need to be persistant.

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Originally posted by Edneeis
    Make sure that the form is really called frmOptions?

    On the form at the top where it says:

    Public Class Form2

    it should say:

    Public Class frmOptions

    If you change it then you will get an error in the autogenerated code too because there is one spot in there that you will need to change Form1 to frmOptions also. Or you could search and change it.
    You see at the top of the picture in the code window it says 'Public Class Form1' well go to the Options form and make sure it says 'Public Class frmOptions' in that one.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    oregon
    Posts
    88
    k they should be all named correctly now, but i get a compile error when i put it what u typed b4.
    To get somthing out of life, you always need to be persistant.

  8. #8
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Did you search in the auto generated code for another reference that has to be changed to frmOptions?

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    oregon
    Posts
    88
    this is the only frmoption that there was....

    To get somthing out of life, you always need to be persistant.

  10. #10
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I think you have to check 'Search Hidden Text' for it to search the collapsed regions. But there is onw spot in the in the 'Windows Form Designer generated code'.

    Also make if you rename your startup form that you reset the startup object in the Project properties.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    oregon
    Posts
    88
    here i found 2 more that were named frmoptions.

    To get somthing out of life, you always need to be persistant.

  12. #12
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Actually you should be searching for whatever it was called before you changed it to frmOptions. You need to change it TO frmOptions so it isn't currently named frmOptions.

  13. #13
    Lively Member
    Join Date
    Nov 2002
    Location
    Perth - Australia
    Posts
    105
    Originally posted by johnsx2002
    With this error i think that you have your startup object set to submain, instead of frmmain.

    To change/check this, right click on your project (in solution explorer) and choose properties.

    There is a combo box with you startup object selected. Make sure this is set to frmmain

    Hope that helps

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