Results 1 to 9 of 9

Thread: I need a vb6 to vb.net translation dictionary

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    4

    I need a vb6 to vb.net translation dictionary

    I need a vb6 to vb.net translation dictionary

    in vb 6, i was able to control object of form from other forms. ex:

    form1 obj:
    label
    text box
    button

    form2 obj:
    label
    text box
    button


    while in form 2:
    form1.testbox.text = "sdfasjfla"

    while in form 1:
    form2.testbox.text = "sdfasjfla"


    how do you do that is vb .net

  2. #2

  3. #3
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Smile

    We should make this mandatory reading for all new VB.NET people.

    Data across two forms
    ~Peter


  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    4
    Here's what i am actually trying to do. i have form1 as a menu. calling form 2 on a biutton click. there is a media player on form1 that starts play on exec. i have it stopping when i open form2. but i need a way to start the player back up. it isn't really passing data form to form, it is more like doing a method on a parent form.

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You need to make the method public. Then you still need a reference to the form your calling the method on. Then you just do myForm.Method()

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    4
    not to sound dumb, but how do you make a method public

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    No such thing as a dumb question...

    Here is a private method:
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.  
    3.     End Sub
    Here is a public method:
    VB Code:
    1. Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.  
    3.     End Sub

    Notice the first word in the method. It is the access modifier. It can be private, which means only available to the class itself, or public which means it can be accessed from other objects as well as the class itself. There are other ones like friend, but you probably don't need it now, but you might want to look it up later.

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    4
    even if it is a pre rpogramed method like player.play() or player.stop()?? i am using a windows media player control if that helps

  9. #9
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Post your code, I will look at what your doing and show you how to do it.

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