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


ADVERTISEMENT

Pass A Variable To Another Form Or Else Make The Variable Visible To Both Forms?

Sep 5, 2010

Using Visual Basic 2008 Express. I need to pass a variable to another form. Or else make the variable visible to both forms.

View 4 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

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

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

Forms - Pass Variable From Child To Parent Like A Function

May 23, 2012

I have created 2 forms (Parent & Child), i want to store the unique textbox value to a variable into the parent form.

[Code]...

View 2 Replies

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

Forms :: How To Bind Form Label Or Text Box To Class Variable

Mar 11, 2009

I have a problem to solve and not quite sure if the way I think is correct.

I have a main form class MainForm the class has got: a variable call Value and a label called LabelValue

Now I would like to automatically update LabelValue every time the Value changes his value

View 2 Replies

Class Inheritance Object Variable Or With Block Variable Not Set?

Sep 26, 2011

i had a class called Tag with a structure like:

public class Tag
private _members
public properties
public shared database_methods
end class

this class was tailored for mysql database. i'm currently adding access 2007 support so i split tag into tag and tagdata with structures like:

[Code]...

View 2 Replies

Inside The Service Class, Declare A Class Variable Named Started?

May 8, 2012

Create a class named Service. Inside the Service class, declare a class variable named Started. The datatype of this variable is Boolean.Public Class Service Dim started as Boolean End Class Create a class named Server. Inside the Server class, declare a dynamic array that can contain elements of the type Service.(Note: For convenience, both the array and the variable Started can be accessible from a client program that creates an instance of Server and Service respectively)

Create a constructor for the Service class. When the constructor is executed, it will set the value of the class variable Started to True. Create two new classes: WebServer and DatabaseEngine. Both of these classes inherit from the class Service. Inside the Service class, declare a Sub procedure (method) named Terminate. This method should display the following text Service stopping in a message box when executed.This method can be overridden in classes that inherit from Service class.

Inside both the WebServer and DatabaseEngine class, override the method Terminate inherited from their base class Service. Both methods should first call the base class Terminate method. The messages Web server stopping and Database engine stopping should also be displayed in a message box when the Terminate method for the WebServer and DatabaseEngine are called respectively. These messages should only be displayed if the Started variable inherited from their base class is not equal to False.

Inside the Server class, declare a method named Shutdown. This method does not return any value. When executed, it will call the Terminate method for each of the Service instances (if any) in the arrServices
array. You should call the Terminate method within a For Each loop that loops through the elements of the arrServices array.

In the Sub Main method, create an instance of the class Server. Set the size of the arrServices array in
your Server instance to contain 2 elements. Create first a WebServer instance and then a DatabaseEngine
instance into this array. Call the Shutdown method from your Server instance.

View 7 Replies

Unable To Use An Instance Of The Nested Class Through A Public Variable Of The Parent Class?

Jun 7, 2012

I want to created a nested class that can only be visible to and instantiated from the parent class.But I also want to be able to use an instance of the nested class through a public variable of the parent class.I tried making the nested class private, or making the nested class' constructor private, but it won't compile.Is it possible to do this in .NET?

[Code]...

View 3 Replies

Can't Set DataTable Class Level Variable = Class Table Property?

Sep 29, 2011

I have procedure (Import) that calls a for a new instance of frmImportData. I also have a class name clsBatch that has a data table property called prpParametersTable.For some reason, I get an error (indicated below with ERROR>>>) when trying to assign prpParameterTable to cv_dtImport2. The error states "Object reference not set to an instance of an object.". Why does this error not happen when I assign dtBP to cv_dtImport1? Both cv_dtImport1 and cv_dtImport2 are equal to Nothing and in my Import procedure dtBP = prpParametersTable.

Public Sub Import(ByVal clsB As clsBatch)
Try
Me.cv_clsB = clsB

[code]....

View 5 Replies

Class Property Usage - Unable To Retrieve A Variable From On Class

Nov 14, 2009

I have three class files, accounts.vb and transactions.vb in addition to my form.vb. I am unable to retrieve a member variable from on class from inside the other. When the combobox index changes, the program loads the correct account (checking or saving) from two different sequential files. I don't think I have the calcBalance procedure in the correct class file. And that is what I am having trouble with. Accessing it to display it. [Code]

View 1 Replies

How To Pass The Variable

Jul 8, 2009

ok to start i know very little about VB6 but i am very good in true basic lol (stupid school teaching the wrong language -_-) anyway im just asking you to make the answer as clear as possible because i don't know very much. heres the problem . ok in the above example i have a button that (for my example) can be used to build a house (lol) i then have a variable in the button sub called money which will have 150 subtracted from it when the button is clicked my problem is it say variable not defined when using this button ... i have declared the variable in a module and in form load along with my other 50 or so variables. my question is how do i pass the variable into this sub and then send the new value back into form load so it can be sent into another sub for more calculations.

View 14 Replies

How To Pass Variable Between Sub

Jan 14, 2010

I currently have the following funcion:

Public Sub GetUserAmount(ByVal ConnectionString As String)
Dim command1Text As String = "SELECT Wager FROM Donations1 WHERE DonationId = (SELECTCOUNT (BidCountHistory) FROM BidCountHistory)"

[Code]......

View 4 Replies

Pass A Variable By Name?

Aug 6, 2011

I need to pass a variable by name like this

Dim html_news = "...the news ..."
Dim var = "news"
Dim a = "html_" & var
' content of that variable

How can I do that in VB.NET ?

View 1 Replies

Pass A Variable From VB To VBA?

Sep 7, 2011

I am currently trying to teach myself how to program VB.Net in Visual Basic 2010 Express.I've been working on a little project for a while and have hit a wall. Normally I can find what I need online but I am now at a complete loss. Essentially I am trying to pass a pair of variables from Visual Basic (file names actually) to VBA so that I can copy/paste data from them using VBA. What I need is to find out how I can pass variables (in string form) back and forth between VB and VBA

View 13 Replies

Pass Variable From One Sub To Another?

Oct 1, 2011

I have a Public Sub where I declared

Dim Elev As Double

later under that Sub I have the program go to anothrer SubRoutine that uses the same Elev variable. Within that subroutine I get a Variable not declared error. My book talks about using "Static" but in the context i guess I am using it, it hasn't worked.

What is the best method of tranfering the information from one sub to another.

View 1 Replies

Pass Variable To A DLL?

Oct 12, 2009

I am using VS 2008.I have an application that has a variable defined as an Application Setting. I use this variable to define the connection string so I can change the location of the database withour having to recompile the application.My application references a class library. The Class Library is the one that manages the database. The DLL is referenced by my application.How can I make the class library use the Connection String defined as an Application Setting of the consuming application? If I say in the class library:sdRadhaAllied.Schema.Connections(0).ConnectionString[code]...

View 4 Replies

Pass Variable To DLL?

Sep 17, 2009

VS 2008, .NET 2, Win XP I need help with passing a String variable from App to DLL?Why: I have App that on UnhandledException needs to call ErrorReport dll, send to that dll some strings like: App name, stack, error... Dll will send through internet this gathered data to me.

I can open Dll, close it, code it, but I can not figure it how to send data to it like VB App name, VB App version, VB App error.message For example I can in my form make a global variable like Public TestGlobal As String and that I can call from anywhere in my app, but how to do it with dll?

[Code]...

View 3 Replies

Error - Base Class 'System.Windows.Forms.Panel' Specified For Class 'MenuButton' Cannot Be Different From The Base Class 'System.Windows.Forms.UserControl'

Mar 12, 2010

When I do this

Public Class cInherits : Inherits Panel

I get this: Base class 'System.Windows.Forms.Panel' specified for class 'MenuButton' cannot be different from the base class 'System.Windows.Forms.UserControl' of one of its other partial types.

How do I inherit?

View 4 Replies

Variable Class Names - Rename My Class Human To Man

Dec 18, 2009

What i'm trying to do:

I've got a library which includes a class:

Class Human
End Class
and another class which refers to the human class

Class ASD
Private somevar as new Human
End Class

Ok now i've got a problem, i wish to rename my class Human, to Man. i've got to change Human to Man 2 times, which is OK but the problem is that in the real case, its not just 2 times, its like 500 times or more.

Well its something like a PHP on Javascript.

the following shows the solution of what i'm trying to do, but its in another language PHP/Javascript:

note: in php $ sign declares a variable, echo writes the variable out

CODE:

Is there anyway to do that with VB?

View 6 Replies

C# - Pass A Variable From One App Domain To Another

Aug 9, 2009

I'd like to know, if I have a variable,for example, a string, how to pass its value to my new app domain:

static string _str;
static void Main(string[] args) {
_str = "abc";

[Code].....

View 2 Replies

Pass A Global Variable From A Dll To A Exe?

Sep 20, 2010

How can i pass a global variable from dll project to a exe file, after this i want to run the exe also from the dll.

View 9 Replies

Pass A Querystring Variable In MVC?

Oct 4, 2010

I would like to create this url blah.com/preview?h=yes

so i can do this

<% if request.querystring("h") = "yes" then %>
jquery stuff
<% else %>
don't do jquery stuff
<% end if %>

View 3 Replies

Pass Variable On Eventclick

Sep 8, 2011

I have a grid of NumericUPDown fields. When a value is changed, I want the page to update a label at the bottom of a column - its a total line. Everything works, when the page is updated(a button click), but I want it to update real time. as they are changing the updown value... My question, and I have searched and couldn't find it, how do I pass a variable to an eventclick subroutine? Or make the variable a global variable, so it will work in the eventclick subroutine...

View 2 Replies

Pass Variable To A Sql Query?

Nov 17, 2010

I have 2 public variables that I declared in form1 of an application. I am trying to call that variable in form2 and then pass that variable in a sql query. [code]...

View 2 Replies

Asp.net - Pass Javascript Variable To Codebehind?

Dec 26, 2011

Is it posible to get a value from a javascript variable and use it into visual basic code without incrusting value on any control.

View 1 Replies

Asp.net Pass Variable From Code Behind To .aspx?

Sep 25, 2010

I can't find a way to pass a simple variable from my code behind file to the .aspx page.

In code behind I have:

Dim test As String = "test"

and in my aspx page I try: <%=test %>

that gives me the following error: Error 2 'test' is not declared. It may be inaccessible due to its protection level

View 4 Replies







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