Results 1 to 8 of 8

Thread: [RESOLVED] textbox ?

  1. #1

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Resolved [RESOLVED] textbox ?

    I get the following error for my sub. Whats wrong and how do I correct it?

    C:\Documents and Settings\Don\My Documents\Visual Studio Projects\FLV Player\Form1.vb(154): Reference to a non-shared member requires an object reference.


    VB Code:
    1. Private Sub AxShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)
    2.         If (command = "info") Then
    3.             Form1.TextBox1.Text = Form1.TextBox1.Text & args & vbNewLine
    4.         Else
    5.             MsgBox(args)
    6.         End If
    7.     End Sub
    He who never made a mistake never made a discovery?

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: textbox ?

    Are you trying to access Form1's controls from some another form?

    If so then you need to understand one thing that the Forms in .NET are not objects like VB 6.0 rather they are classes. So before using them you need to instantiate them and if you have already instantiated them then if you are trying to access it from some other object, that object has to know about the instance of the form.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  3. #3

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Re: textbox ?

    Is this correct then?
    VB Code:
    1. If (command = "info") Then
    2.             TextBox1.Text = TextBox1.Text & args & vbNewLine
    3.         Else
    4.             MsgBox(args)
    5.         End If
    He who never made a mistake never made a discovery?

  4. #4
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: textbox ?

    Go through this article on how Forms work in VB.NET
    http://www.devcity.net/Articles/94/multipleforms.aspx

    Thanks to jmcilhinney for the links.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  5. #5
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: textbox ?

    Can you tell us what exactly you are trying to do? It will be easier to help.

    And if you are doing something with the commandline arguments then you should be using Environment.CommandLine. Also CommandLine will have more than one parameter, the first being the name & path of the EXE that you are executing and second onwards will the parameters that you are passing.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  6. #6

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Re: textbox ?

    I have a text box on my form and when my shockwave component plays my movie there is a variable called "info" in the flash movie that the FSCommand can read. I am trying to get that information into the text box. I know how to do it in VB6, but now I am using VB.Net 2003. I also think the FSCommand arguments are incorrect.
    He who never made a mistake never made a discovery?

  7. #7

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Re: textbox ?

    I came across this code on google and it works but not all the arguments are displayed in the text box. Only the last element - duration; is showing up. How would I get all the values show up in my text box?

    The command "info" should be passing the following data:

    creationdate = Thu Dec 11 20:26:37 2003
    framerate = 983040
    audiodatarate = 64
    videodatarate = 200
    height = 240
    width = 320
    duration = 55.7557563781738



    VB Code:
    1. Private Sub axShockwaveFlash1_FSCommand(ByVal sender As Object, ByVal e As _
    2.           AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent) _
    3.           Handles AxShockwaveFlash1.FSCommand
    4.  
    5.         ' Use a select case statement to filter the command being passed  through
    6.         Select Case e.command
    7.             Case "info"
    8.                 ' Output the arguments
    9.                 'MessageBox.Show("The Arguments were: " & e.args)
    10.                 TextBox1.Text = ""
    11.                 TextBox1.Text = e.args
    12.  
    13.         End Select
    14.     End Sub
    He who never made a mistake never made a discovery?

  8. #8

    Thread Starter
    Fanatic Member Navarone's Avatar
    Join Date
    Jun 2003
    Location
    Akron, Ohio USA
    Posts
    740

    Re: textbox ?

    ok, I got it figured it out. I changed the this line to this
    VB Code:
    1. TextBox1.Text = TextBox1.Text & e.args & vbNewLine
    He who never made a mistake never made a discovery?

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