473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Form Variables

I have a form (form1). I made a dialog box for it called (Dialog1). Form1
has 2 initialized classes. I need to be able to modify the value of a
variable in form1 from form2 when the OK button is clicked. I know how to do
this in visual basic 6 (which i no longer use very much because .NET is much
better).

Thanks


Nov 21 '05 #1
4 1464
Is Form2 created as an object in Form1? If you are, then just add a
reference of form1 to form2 when you create it.

Public class Form2
dim F1 as Form
sub new(byref Form1Ref as Form)
F1 = form1ref
end sub
sub SomeFunction
F1.SomeProperty = Me.Something
end sub
end class

public class form1
sub SomeFunction()
dim F2 as new form2(Me)
end sub
end class

Hope it helps
Chris

"sympatico" <fe******@a1vbcode.com> wrote in message
news:Z4********************@news20.bellglobal.com. ..
I have a form (form1). I made a dialog box for it called (Dialog1). Form1
has 2 initialized classes. I need to be able to modify the value of a
variable in form1 from form2 when the OK button is clicked. I know how to
do
this in visual basic 6 (which i no longer use very much because .NET is
much
better).

Thanks

Nov 21 '05 #2
Is Form2 created as an object in Form1? If you are, then just add a
reference of form1 to form2 when you create it.

Public class Form2
dim F1 as Form
sub new(byref Form1Ref as Form)
F1 = form1ref
end sub
sub SomeFunction
F1.SomeProperty = Me.Something
end sub
end class

public class form1
sub SomeFunction()
dim F2 as new form2(Me)
end sub
end class

Hope it helps
Chris

"sympatico" <fe******@a1vbcode.com> wrote in message
news:Z4********************@news20.bellglobal.com. ..
I have a form (form1). I made a dialog box for it called (Dialog1). Form1
has 2 initialized classes. I need to be able to modify the value of a
variable in form1 from form2 when the OK button is clicked. I know how to
do
this in visual basic 6 (which i no longer use very much because .NET is
much
better).

Thanks

Nov 21 '05 #3
Well, if you make each of your variables a public property of your form
you could set and get them easily.

So in form2 you would do something like
form1.MyValue = 1

"sympatico" <fe******@a1vbcode.com> wrote in message
news:Z4********************@news20.bellglobal.com. ..
I have a form (form1). I made a dialog box for it called (Dialog1). Form1
has 2 initialized classes. I need to be able to modify the value of a
variable in form1 from form2 when the OK button is clicked. I know how to do
this in visual basic 6 (which i no longer use very much because .NET is much
better).

Thanks

Nov 21 '05 #4
Well, if you make each of your variables a public property of your form
you could set and get them easily.

So in form2 you would do something like
form1.MyValue = 1

"sympatico" <fe******@a1vbcode.com> wrote in message
news:Z4********************@news20.bellglobal.com. ..
I have a form (form1). I made a dialog box for it called (Dialog1). Form1
has 2 initialized classes. I need to be able to modify the value of a
variable in form1 from form2 when the OK button is clicked. I know how to do
this in visual basic 6 (which i no longer use very much because .NET is much
better).

Thanks

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: TG | last post by:
Conditions: Register globals is set to on. Parse html as php is set to on. I have two forms OrderTest1 and OrderTest2 and need to be able to validate the data from OrderTest1 before passing to...
10
by: Dave Karmens | last post by:
If I have say 10 fixed variables, how can I set their values = to that of a form that is built dynamically? column1 column2 email = formvalue(0) fname = formvalue(1) lname = formvalue(2)...
13
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide...
19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
4
by: Baz | last post by:
Hi. I'm new to this VB.Net mullarkey, and I must say it is proving to be a very trying experience. Here is the latest in a long line of problems: The Scenario ========= I am building an...
7
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
4
by: dac | last post by:
I am quietly going insane on this project. I've never worked on a project like this one before. All my previous sticky forms were for data entry, not editing. I don't know how to display the form...
0
by: joshuajnoble | last post by:
Hi all, I'm having a strange problem where I need to build out form variables in an HTTPWebRequest and send them to an aspx page for processing. The page isn't recognizing the form variables at...
8
by: chromis | last post by:
Hi, I'm writing a contacts section for a cms on a website, I've decided to write the section in OO code. So far I have my Contacts object and a page structure I would use for a procedural site. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.