To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Article :: Building Dynamic Systems with Expressions in .NET
How Is XML Like An Interface?
Understanding Covariance and Contravariance
Print VS 2010 Keyboard Shortcut References in Letter (8.5x11in) and A4 (210×297mm) Sizes
Updated Productivity Power Tools



Go Back   VBForums > Visual Basic > Visual Basic .NET

Reply Post New Thread
 
Thread Tools Display Modes
Old Jun 2nd, 2006, 06:56 AM   #1
Navarone
Fanatic Member
 
Navarone's Avatar
 
Join Date: Jun 03
Location: Akron, Ohio USA
Posts: 740
Navarone is on a distinguished road (10+)
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?
Navarone is offline   Reply With Quote
Old Jun 2nd, 2006, 07:11 AM   #2
Shuja Ali
Shared Member
 
Join Date: May 05
Location: Kashmir, India
Posts: 2,277
Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)
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
Shuja Ali is offline   Reply With Quote
Old Jun 2nd, 2006, 07:13 AM   #3
Navarone
Fanatic Member
 
Navarone's Avatar
 
Join Date: Jun 03
Location: Akron, Ohio USA
Posts: 740
Navarone is on a distinguished road (10+)
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?
Navarone is offline   Reply With Quote
Old Jun 2nd, 2006, 07:13 AM   #4
Shuja Ali
Shared Member
 
Join Date: May 05
Location: Kashmir, India
Posts: 2,277
Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)
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
Shuja Ali is offline   Reply With Quote
Old Jun 2nd, 2006, 07:16 AM   #5
Shuja Ali
Shared Member
 
Join Date: May 05
Location: Kashmir, India
Posts: 2,277
Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)Shuja Ali is a jewel in the rough (300+)
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
Shuja Ali is offline   Reply With Quote
Old Jun 2nd, 2006, 07:23 AM   #6
Navarone
Fanatic Member
 
Navarone's Avatar
 
Join Date: Jun 03
Location: Akron, Ohio USA
Posts: 740
Navarone is on a distinguished road (10+)
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?
Navarone is offline   Reply With Quote
Old Jun 2nd, 2006, 07:53 AM   #7
Navarone
Fanatic Member
 
Navarone's Avatar
 
Join Date: Jun 03
Location: Akron, Ohio USA
Posts: 740
Navarone is on a distinguished road (10+)
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.         ' Use a select case statement to filter the command being passed  through
  5.         Select Case e.command
  6.             Case "info"
  7.                 ' Output the arguments
  8.                 'MessageBox.Show("The Arguments were: " & e.args)
  9.                 TextBox1.Text = ""
  10.                 TextBox1.Text = e.args
  11.         End Select
  12.     End Sub
__________________
He who never made a mistake never made a discovery?
Navarone is offline   Reply With Quote
Old Jun 2nd, 2006, 08:01 AM   #8
Navarone
Fanatic Member
 
Navarone's Avatar
 
Join Date: Jun 03
Location: Akron, Ohio USA
Posts: 740
Navarone is on a distinguished road (10+)
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?
Navarone is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic .NET


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:04 PM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.