|
-
Jun 2nd, 2006, 06:56 AM
#1
Thread Starter
Fanatic Member
[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:
Private Sub AxShockwaveFlash1_FSCommand(ByVal command As String, ByVal args As String)
If (command = "info") Then
Form1.TextBox1.Text = Form1.TextBox1.Text & args & vbNewLine
Else
MsgBox(args)
End If
End Sub
He who never made a mistake never made a discovery?
-
Jun 2nd, 2006, 07:11 AM
#2
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
-
Jun 2nd, 2006, 07:13 AM
#3
Thread Starter
Fanatic Member
Re: textbox ?
Is this correct then?
VB Code:
If (command = "info") Then
TextBox1.Text = TextBox1.Text & args & vbNewLine
Else
MsgBox(args)
End If
He who never made a mistake never made a discovery?
-
Jun 2nd, 2006, 07:13 AM
#4
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
-
Jun 2nd, 2006, 07:16 AM
#5
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
-
Jun 2nd, 2006, 07:23 AM
#6
Thread Starter
Fanatic Member
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?
-
Jun 2nd, 2006, 07:53 AM
#7
Thread Starter
Fanatic Member
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:
Private Sub axShockwaveFlash1_FSCommand(ByVal sender As Object, ByVal e As _
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent) _
Handles AxShockwaveFlash1.FSCommand
' Use a select case statement to filter the command being passed through
Select Case e.command
Case "info"
' Output the arguments
'MessageBox.Show("The Arguments were: " & e.args)
TextBox1.Text = ""
TextBox1.Text = e.args
End Select
End Sub
He who never made a mistake never made a discovery?
-
Jun 2nd, 2006, 08:01 AM
#8
Thread Starter
Fanatic Member
Re: textbox ?
ok, I got it figured it out. I changed the this line to this
VB Code:
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|