Call A SWF Object From Another Form?
Jun 18, 2011
I am trying to call a SetVariable command from an other form. For example, there is a movie ( called Movie ) on Form1, and a button on Form2. The button on Form2 needs to use a command like the following:
Call Movie.SetVariable("example variable", 1)
The above variable needs to be set to the movie on Form1, but I need the button to call it to be on Form2.
View 2 Replies
ADVERTISEMENT
Nov 12, 2009
My problem is when i try to call Application.Run() in a application without a form i get "Object reference not set to an instance of an object." when i run it outside VS. but if ran in debug or release mode it works just fine. i may just be forgetting to setup application right, but ive done it before in this same manor and it worked fine.
Sub main() 'this runs first.
AddHandler Application.ApplicationExit, AddressOf ExitEventHandler
dbg_f("handle added")
[CODE]...
Commented out init_timer and init_ready, and now it causes the same error for the myName line. there seems to be something wrong with class Application. btw theres seems to be something wrong with the forum code formatting.
View 4 Replies
Sep 22, 2010
I have a VB .NET 2010 application. I added a C# project to my solution. I tried to call the form called 'main'. However, I could not figure out a way to do that. What is the best way to do that? I Goggled, and did not find anything. Actually I noticed that my Developer converted everything to VB .NET.
View 5 Replies
Jun 7, 2010
I am utilizing a centralized class object that needs to call another class object. The program itself will do something like the following
sFieldValue = CentralObject.ObjectHandler(1, TestFunction, "FunctionVar,FunctionVar2,FunctionVar3")
In the central object I have a function
Public
Function ObjectHandler(ByVal ObjectType
As
Integer,
[code]....
View 5 Replies
Apr 3, 2009
may I just ask a seemingly simple question for which I can't find any solution throughout all the VB.NET documentation: I have to call a (non-static) method of another object (instance!) based upon the name of the method (given as a string).
View 1 Replies
Nov 5, 2010
I have a form and I am calling a method from a module in that form. However, how to do i call the object into the method, since Me doesn't work.
Example:
in the module:
Function printname()
Console.WriteLine("Form called with is titled:" + me. text)
[code]....
View 7 Replies
May 23, 2011
Is it possible to recall a string or object that was stored in a previous sub? The below code gives you an idea as to what I am trying to do.
Sub StoreUserData()
Dim StorName as Object
End
Sub WriteUserFile()
'Recall StorName here
End Sub
View 2 Replies
Apr 21, 2012
I have a method called ADD in a class that connects to a database. The database class name is XDB. I also have an object named XXX in it's own separate class with properties.One of the instructions for the Button named ADD click event is:
'Call Add method passing in the XXX object
So this is how I coded:
'declare a variable X as an object instance of XXX
Dim X As New XXX[code].....
I know it's wrong since it doesn't add the XXX and the form doesn't close but I don't know what I'm doing wrong.
View 6 Replies
Aug 18, 2011
(New clsViewIllus).View(MyIBaseView, enumViewSolveTypes.View, Me, , True)
... in VB? Basically too lazy to do this:
Dim vi As New clsViewIllus
vi.View(MyIBaseView, enumViewSolveTypes.View, Me, , True)
View 3 Replies
Nov 30, 2010
I have some files in vb.net that have "Option Strict Off" to allow for bad programming. When I convert to c# I use "dynamic" until I come back and fix problems, and this works in all cases But now I have this code:
Public Class ContractResults
'Big class definition
Public Shared Sub CleanCache()
[code].....
And in a file with Option Strict Off:
Public Sub VerifyResults(result as Object)
'Here, result is normally ContractResults
'first it check for that then call this:
result.CleanCache()
End Sub
In c# I use "dynamic", but a runtime error pops up when I call "static" method with dynamic reference. In vb.net, I can called "shared" sub from instance, but in c# this is not allowed
Exception:
"Microsoft.CSharp.RuntimeBinder.RuntimeBinderException"
"Member 'ContractTypes.ContractResults.CleanCache()' cannot be accessed with an instance reference; qualify it with a type name instead"
It seems I must convert code to use actual type, but then this means much rewriting of more parts. Is anyone able to show another way?I want to make sure you do not think I can use (result as ContractResults).CleanCache();Because all types that may be passed in have "CleanCache()" method, but do not inherits from anything the same other than "Object". There are many types (30!) that have this "static" method and so that is why it uses Option Strict Off?
View 3 Replies
May 23, 2011
How can I raise an event from another class which implements an interface that contains an event?
Public Interface IMyEvent
Event MyEvent()
End Interface
[Code].....
Note the comment - that code doesn't work. How can I raise an event like this, if it's contained within another class through an interface?
View 1 Replies
Apr 24, 2012
So I'm trying to write a MasterMind game, but I have a problem I have 40 pictureboxes set up in 10 different rows, and I want to have one code handle all 10 rows, rather than copying and pasting the code and changing the names of the pictureboxes. I've been trying to use a variable to achieve this, but if it's possible, then I don't know the correct way to do it.This is what I have right now:
[Code]...
View 1 Replies
Mar 2, 2009
I am using following code for browser helper object. But when I try to run this BHO in internet explorer SetSite method is not called.
using System;
using System.Collections.Generic;
using System.Text;
using SHDocVw;
using mshtml;
using System.IO;
using Microsoft.Win32;
[Code] .....
View 1 Replies
Jul 8, 2009
I have a webpage that contains an ActiveX object, called object1, and a javascript function, called alertMe(input). I wish that if user clicks on different location on object1, it will call the javascript function. Is it possible to do this? If it's possible, how should I write the calling in the ActiveX object?
View 1 Replies
Jun 3, 2011
I have two forms. Form A and Form B. Form A has a datagrid that is populated from a SQL Database Table query. When a button is pressed Form B is launched that allows you to add a record to the database table. I need for the datagrid to be refreshed and show the newly added record when I close form B and go back to the parent.
[Code]...
View 2 Replies
Aug 4, 2009
I need to know the proper way, or maybe I should say, the different ways to call another form from a parent or preceding form. I am currently using ex: formname.showdialog() to call my next form, but I am uncertain if I should be using that in every situation. [code] Whats the difference between these different methods? (ex: .showdialog() , .show() )I tried both of these to open a temporary form to retrieve a persons name from a database, so as the users progresses through my training program they can keep track of their scores.But, I also call other forms as I branch through my program, from the main page, to a secondary page, to a testing page, to a results page and then back to the secondary page
View 5 Replies
May 14, 2010
How can I disable the parent form when I call a child form?This code doesn't disable the parent form like I thought it would:
frmChild.ShowDialog()
View 2 Replies
Jun 1, 2011
Trying to replace Cells(RowIndex,ColumnIndex).Value() calls by row-wise references for performance, I permanently fail at referencing the result. Starting with Excel Interop - Efficiency and performance, which contains the tip to use get_range, i.e.
//get values
object[,] objectArray = shtName.get_Range("A1:Z100").Value2;
iFace = Convert.ToInt32(objectArray[1,1]);
//set values
object[,] objectArray = new object[3,1] {{"A"}{"B"}{"C"}};
rngName.Value2 = objectArray;
[Code]...
However, referencing Values with two dimension indices always returns an "index was outside the bounds of the array" exception. Inspecting the array with the debugger shows a nice 2-dimensional array which should has 17 elements on the second dimension, so Value (0,0) should indeed be a valid reference -- but it isn't:
The debugger lets me inspect Value, I can also drill down to Value(0,0) and see the correct value, but re-evaluating just that element, i.e. inspecting "Value (0,0)" returns above message.
View 2 Replies
Apr 13, 2012
I'm having this problem with my code and cannot seem to get past it although it was working fine before. The error is "An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object." The code is:
CODE:
I am trying to get information to be pulled out of a database and show in text boxes on another form (frmviewsdets). The error occurs when it gets to the line frmviewsdets.txtsnumber.Text = rdr("StudentNumber") and even when a breakpoint is applied there it just moves on to the next and so on.
I have tried to show frmviewsdets before I pull the data out of the database beut I get the same message.
View 14 Replies
Jul 6, 2011
I have a solution with several Projects in it. There is a Windows App project (called ImportClient), and a Class Library (Import.Library). The Import.Library has functions to perform data imports (I have other applications in the solution that also need to call it). But the interactive application, I want to be able to pass in some form controls, and have it update the GUI. No problem. But, I also want to execute a DoEvents() so that the loop execution doesn't hang other interaction to the app.
So, ImportClient has a reference to Import.Library. But I can't add a reference to ImportClient to the Import.Library, because the compiler complains about circular reference, etc. I don't know how else to define the My.Application object of ImportClient as a parameter to the data function in ImportLibrary.
(I realize this is a dumb question - problem is, for this project I have a tight timeline, and haven't learned how to do the BackgroundWorker process. If you think I could pick it up quickly, I'm open to some hints about how to update the progress bar on the GUI, and how to pause / cancel the background task.)
View 1 Replies
Feb 1, 2011
I am trying to program a dialogue box to appear when the exit button from my 'Login' form is clicked. The form has three options; yes, no, cancel.
[Code]...
View 2 Replies
Sep 5, 2010
I have a small program which draws some lines with a method called: Drawlines But Now I want to call this method in the load form routine. So if the form is loaded the lines should be drawn in the picturebox. But is this possible or should the form first be loaded completely before you can call methods in that same form?
View 6 Replies
Oct 20, 2009
Could i call the child form events like (closing ,load, activate,closed) .
View 6 Replies
Dec 7, 2009
I have two form :
class form1 'parent form dim number as integer
public sub create ()
dim f2 as new form2
f2.MdiParent = me[code]....
In form2.vb how to use variable number and method test
View 3 Replies
Mar 10, 2010
I've got 3 forms that have exactly the same functions, so I decided to create an interface.
public Interface IExample
public sub Add()
Public sub Edit()
[code]....
At this point, objfrmExample is now instantiated, even though I've not done a "objfrmExpample = new [what-goes-here?] " and I'm curious as to why.I could possibly guess that because you cannot instantiate an interface variable, then vb.net automatically creates an instance. But thats just a guess. The question is , what is meant by declaring a variable of type Interface, and how does it work?
View 2 Replies
Apr 27, 2010
I am getting this error "Object reference not set to an instance of an object" and I dont know where/how to fix it and it does not tell me where the error in the code occurs, just a pop-up windows saying the error. Here is the code on the "start up" Windows form..
[Code]...
View 6 Replies
Sep 23, 2011
I have to use Form.Action to redirect to a script that will be picking up values from my page. It is worth noting that this script is external.My issue is that I also want the button that is clicked and has the Action hooked up to it, to also complete some functionality in the code behind first.Is there anyway I can either :In the buttons click event handler, can I set the Form.Action and then call something such as Form.Submit?OR Set up the Form.Action in advance and then somehow have the button posting back before the action takes place.
View 5 Replies
Sep 1, 2009
I have one form called invoiice1.vb In the load event how can i call another form ? I also call some values of thatt form
View 2 Replies
May 4, 2009
I have a sub declared inside a module which accepts form as argument.
sub display(fname as form)
What I need is to call the sub form the load event of a form. I tried the following.
display(me)
But cant access the controls of the form inside the sub.
sub display(fname as form)
fname. 'no controls of the form are listed?????????????
end sub
View 3 Replies
Feb 2, 2010
I added toolstrip control into MDI form. on the parent form, creat many toolstripbutton like tbAdd, tbSave,tbEdit.When I open child form, how to call tbAdd or tbSave.. toolstripbutton on the MDI?
View 1 Replies