Pass String Between Forms Instance?

Sep 3, 2010

how to pass string between forms instance throw the instance it self not any other form

View 6 Replies


ADVERTISEMENT

Initialize A New Instance Of A Class, But Pass It To Other Forms Too For A Wizard Based App?

Dec 20, 2011

As an ameture developer, I've never really used classes. However, I've been reading about using classes and automatic properties. I have therefore created a class which looks similar to this:

Public Class Quote
Property QuoteNum as integer
Property AccNum as String
Property Price as Decimal
End Class

The stumbling part for me comes in the way of letting form2 know which class form1 has initialized. There are in this example 3 forms to this wizard. If someone starts another wizard whilst half way through the first wizard we need to keep the variables seperate hence using the class. I think I'm along the right track, but maybe confusing myself a little.

[Code]...

View 12 Replies

Create A New Instance Of The Moblist Class Each Pass?

Jan 13, 2011

I have an application that reads another processes memory.I initially had multiple scanning threads for the various areas I needed to read.This was processor intensive so I decided to go with the observer pattern.All was well except that I am having a weird behavior.Here is what is happening.I have 2 radars (overlay and mapped)Both have a watcher class that attaches to the memory scanner and is notified on a new list of mobs.so I open radar 1 (mapped) it attaches it's watcher to the scanner and waits for mob list update notifications

Open radar 2 (overlay). same thing happens and another watcher is attached.all is well and good so far.Now there are properies on the mobs in the list, one of which is IsFilteredOut.This property is set in the radar code after it receives the list. Now the weird behavior is that no matter what I do, the second radar to be opened changes all the properties of the mobs in the list of both radars.It is as if I am passing the list by ref, but I am not.I actually create a new instance of the moblist class every time I pass the list.Here is the notify code. As you can see I create a new instance of the moblist class each pass.

Private Sub NotifyMobListUpdated(ByVal Mobs As List(Of MobData))
If Mobs IsNot Nothing Then
For Each w As Watcher In _watchers[code].....

View 1 Replies

Class Library (dll) Single Instance To Pass Data Between Processes Or Exe's DESIRED BADLY

Oct 20, 2010

The "named pipe" seems rediculous to pass data between processes (exe's). Is it possible to run a single instance of a VB.NET Class Libary (dll) such that two programs can access the same memory resident dll, thereby passing data via functions and or subs?When I try to make the class library as single instance, the "Enable Application Framework" is greyed out, and thus the option to "Make Application Single Instance" is also greyed out.When I try to call the dll from two processes, I simply just create two instances, so storing data in a module doesn't work

View 2 Replies

Reference To The String In The Heap Is Passed Even When You Pass The String ByVal To A Method?

Mar 2, 2011

So strings are reference types right? My understanding is a reference to the string in the heap is passed even when you pass the string ByVal to a method.

String myTestValue = "NotModified";
TestMethod(myTestValue);
System.Diagnostics.Debug.Write(myTestValue); /* myTestValue = "NotModified" WTF? *[code].....

And what is going on under the hood? I would have bet my life that the value would have changed....

View 5 Replies

Get "Object Reference Not Set To An Instance Of An Object" Error When Trying To Find An Instance In A String?

Jan 23, 2009

I am using the IndexOf function of the string class to find a specific instance of a string. And based on that I have a logic to do something. Below is the example of what I am doing. The code is in production and is working fine. But for some instance I am getting an "Object reference not set error". Yeah its intermittent.The requestXML is a string of xml data passed in as a paramter to a subroutine. I am fetching the xml string as a form post in a request object. The only thing I could think of getting this kind of error is when the requestXML string varia

requestXml = Request("requestXML")
SubmitRequest(requestXml)
Private
Sub SubmitRequest(ByVal requestXml

[code]....

View 5 Replies

Use String.format On A Url To Pass Several Values Into The String?

Feb 3, 2012

I am trying to use string.format on a url to pass several values into the string. It's probably a simple error but I cannot get the following code to work. It doesn't even build the string.

Public Sub getStockData()
Dim client As New WebClient()
Dim url As String

[code]....

View 1 Replies

Forms :: How To Refresh Browser Instance

Oct 4, 2010

Can we Refresh Browser Instance using VB.NET 2005

View 1 Replies

Use An Instance Of A Class On Multiple Forms?

Aug 29, 2011

I don't know how to do this and I've googled this to death.

View 2 Replies

CanNot Pass Variable Between Forms?

Sep 11, 2009

i have a dialogbox (dialog1) i will assign the input from textbox a variable to the from1 but i cant do that.the variable in form1 is Dim get_from_dbox As Long i try to assign to it from dialog1 like below it fails form1.get_from_dbox = Textbox1.Text but i can assign to textbox??like that which works well

form1.RichTextBox1.Text=Textbox1.Text I am new programing i know i am wrong .don't know where?

View 1 Replies

How To Pass Variables Between Forms

Sep 6, 2009

I am having trouble passing variables between forms. Ive tried many methods but none seem to work. The first method I tried was to dim a public variable on the first form and call it on the second....no success

Form 1:
Public cliCode as string
cliCode = me.tbClientcCode.text

Form 2:
dim clientCode as string = form1.clicode
or

Form 2:
dim clientCode as string

On the Form2 load event....
clientCode = form1.clicode

With method 2 I created some classes on which form 1 loads and form2 access........
Public
Class frmClient
Private db As New ClientDataContext
Public clientInstance As New BusinessLogic.classClient
Public cliCode As String
[Code] .....

View 18 Replies

Pass A Row From One Forms Datagridview To Another?

Mar 23, 2011

How to pass a row of datagridview of form1 to the other form2 datagridview

View 2 Replies

Pass Data Between Forms?

Oct 3, 2011

Is this way a "right" way to pass data between two forms?[code]...

View 1 Replies

Pass More Than One Variables Between Forms?

Mar 6, 2010

Code below just allow me to pass only one variable at one time..the code below show how to pass the platelabel to label3..

how can i pass 2 variable in the same time..[code]...

View 5 Replies

Pass Variables Between Forms?

Nov 10, 2011

I know this should be easy but I'm either having a brain fart or I'm just more inept than I thought; probably a combination of the two.

Passing a value to a form on startup is a piece of cake, but I don't think I've ever had to do the following before in all my ooooh, 8 months of programming:

I have a main form with a button and a textbox. The button opens another form with a datagridview. What I want to do is pass the selected value from the DGV back to the textbox on the first form.[code]...

View 8 Replies

Forms :: Form Does Not Open Correctly On Second Instance

Nov 13, 2010

I have a question that I hope to find a much more simpler solution to.I have two forms in my program which are named Main and Second. The Second form has several textboxs, buttons (some disabled) and comboboxes. When the Second form is opened via the Main form on the very first instance, everything works fine.

However, if I re-open the Second form after previously closing it, the disabled buttons are no longer disabled and the text controls and comboboxes show the previous values entered from the first instance which I do not want. How can I ensure that the Second form will be opened "clean" every time.

Currently I have to add instances to the onload event to do this to ensure that the form is cleared on the second instance.textbox1.text = ""textbox2.text = ""textbox3.text = ""button1.enabled = False

View 5 Replies

Forms :: Open An Instance Of Explorer.exe In A Panel

Oct 24, 2008

I'm having a hard time getting this code to work, here's the code, I'm trying to open an instance of explorer.exe in a vb.net panel. Imports System.Runtime.InteropServices

[Code]...

View 2 Replies

Forms :: Can't Pass Variable From One Form To Another?

Jun 8, 2011

I have one form, which the user enters upto 5 websites then clicks go - I have on the second form, the one with the webbrowser. A timer which checks if the web browser is busy then either a green light or black image will be shown along side the assocaited input box on the first form.I am finding it impossible to feed variables into the clock through ByVal, like I would a subroutine or function.

Private Sub ActiveMe_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ActiveMe.Tick
If ((WebBrowser1.IsBusy)) Then
Hey.BackColor = Color.Black[code]....

'Error message says Hey is not declared, as i can't pass it through to timer

The variable Hey is determined by the first form - Which picturebox.I have an if statement which simply says if inputbox one has url enter then Hey = Picturebox1, If input box2 has url entered then Hey= Picturebox2 etc.What I want is the timer to check the page has completed loading or is still loading or refresing and the appropriate green or black to be shown aside url input box on first form.I considered using a sub or procedure to act as a clock (a large for loop with another for loop within it, acting as a delay). But found this slowed down theapp to the point of crashing it.

View 1 Replies

Forms :: How To Pass Variable From One Form To Another

Jul 17, 2010

I want to pass variables from one form to an other. The variables i I need in the second form( called" Hulsview") are :" hulsbreedte" and" hulslengte". To check if the varibles are passed I added a textbox in the second form,called" hulsview" to check the variable" hulsbreedte". The value selected in the combobox on on form1" hulsbreedte = HulsBreedte1.SelectedValue" returns always 0 in the textbox on de second form.

Here is the code form1:
Imports System.Drawing.Drawing2D
Public Class Form1
Inherits System.Windows.Forms.Form
Public hlb As Point 'not used
[Code] .....
I am using vb express 2010.

View 1 Replies

Forms :: Pass A Variable From Within A Class

Jun 25, 2011

i have a class called car and within that class i have a few vairables

Public Class car
Public Property Name As String
Public Property ID As Byte

[Code].....

View 5 Replies

Forms :: Pass UserControl As An Argument?

Sep 8, 2010

I've got several user controls and every time I add them, I post this

Dim uc As New ucTemplates ' 'ucTemplates' is the name of the actual user contrll
gbControls.Controls.Clear()
gbControls.Controls.Add(uc)

So, I'd like to create a sub that does the same thing, passing the usercontrol as an argument

Private Sub AddUC(myControl as UserControl)
gbControls.Controls.Clear()
gbControls.Controls.Add(myControl)
End Sub

But - when I try:
addUC(ucTemplates)

I get an error that ucTemplates is a type and cannot be used as an expression
I can get it working if I add the Dim uc As New before the addUC - but I'd rather have it so I only repeat one line, not 2

View 1 Replies

Forms :: Internet Explorer Object - New Instance To Be Opened

May 27, 2010

I am developing a application where a url is supposed to be passed to Internet Explorer using a search button. But if more than one url passes it should open in same instance. I dont want new instance to be opened every time. I am using SHDocVw.dll for the same. I have coded for opening a new IE instance and URL is getting passed successfully. But meanwhile if I close that open IE then I get exception and my program dont work.

View 1 Replies

Forms :: Opening Childform Creates New Instance Of ParentForm

Dec 31, 2011

I am in the process of upgrading a VB6 Project to Vb.net. My problem is that when I open a child form in my project from within the Parent form a new instance of the Parent form is created. The code is fairly simple:

frmnewContract.MdiParent = Me
frmnewContract.Show()

View 3 Replies

Use Instance Or Form Name When Addressing Public Variables Between Forms?

Nov 17, 2009

In vb.net, you can address a public variable from another form using the form name along with the variable.

form2.show
form2.k = 3

However, if you use a form variable to show an instance of the form, you must use that variable name to address the public variable. Two instances of the same form are displayed in the following example. The public variable k is assigned a value of 3 only in the first instance of the form, the one from form2.show. frm.k can be used to assign a value to the other form.

dim frm as new form2
form2.show
frm.show
form2.k = 3

Assuming only one instance of the form is shown in the application, is it reliable to address a public variable using the form name (form2.k), or is it better to show the form with a form variable and use that to refer to the instance of the form (frm.k)? Would the same answer apply to a property as well as a public variable?

View 2 Replies

Forms :: Start CMD And Pass A Command To It And Then Monitor It In The App?

Oct 12, 2011

I am trying to start CMD and pass a command to it and then monitor it in the app I am writing. The user enters the information that makes the commandline and when they click Go it does start CMD but straight away it says it can't find the file.Is there any way I can view what is being sent to the CMD prompt to double check that this is correct? Do I need to specify the path to the file I want it to run, i.e. cscript c: estMigrate.wsf?

View 6 Replies

Pass Auto-incremented Id Through Multiple Forms?

Jun 14, 2011

Need advice on what is the best approach to get the auto incremented id to be the same on multiple forms.

Basically I am using VB .Net with SQL Server as the backend. I wrote a few stored procedures to insert data and then I am calling the stored procedures on the front end. I have 3 forms and once the first form is submitted it generates an autoID and then takes the user to 2nd form.

In the second form I have a separate insert stored procedure is there a way to grab the id that the first form generated and for it to be consistent. Or should I store it in a variable after they submit the form and then call it in the second form.

View 3 Replies

Pass Data Between Forms In Different Projects In One Solution?

Apr 21, 2011

I need to pass data (a user name) from a logon form in one vbproj to a form in another vbproj that are compiled in one solution. Public Read Only does not seem to work.

View 2 Replies

Pass Data Between Forms Made At Runtime?

Aug 3, 2009

How to pass data between forms made at runtime? I need to check the data in the form at runtime and accordingly use it in SQL queries to retrieve data from database.

View 2 Replies

Pass Textbox Values Across Multiple Forms?

Nov 4, 2009

I have about 10 boxes on my form1 that the user will populate, I am looking for a "Best Practice solution to pass the values across to form2 and form3. Would like the user to be able to edit the value on either form and have the chnage carry over to the other forms.

View 5 Replies

VB 2010 Way To Pass A Variable Back And Forth Between 2 Forms?

Apr 13, 2011

What's the simplest way to pass a variable back and forth between 2 forms?Let's say I have form1 and form2. Form2 has textbox2 and button2. When button2 is pressed I need the text in textbox2 to display in textbox1 on form1.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved