| | |
Getting Information From Another Form
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 4
Reputation:
Solved Threads: 0
I'm stumped right now, I cannot figure out how to code something to get information from another form.
This is what I'm trying to do:
When I use that code, it tells me that PictureBox1 is not declared, it's because it's not in the same form as TextBox1 and the button.
I know it's probably extremely simple, but I just can't figure it out.
This is what I'm trying to do:
VB Syntax (Toggle Plain Text)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "01" Then 'TextBox1 is in form 2. PictureBox1.Image = System.Drawing.Bitmap.FromFile(My.Application.Info.DirectoryPath & "\Image00001.png") 'PictureBox1 is in form 1. ElseIf TextBox1.Text = "02" Then 'TextBox1 is in form 2. PictureBox1.Image = System.Drawing.Bitmap.FromFile(My.Application.Info.DirectoryPath & "\Image00002.png") 'PictureBox1 is in form 1. End If End Sub
When I use that code, it tells me that PictureBox1 is not declared, it's because it's not in the same form as TextBox1 and the button.
I know it's probably extremely simple, but I just can't figure it out.
Hi
Was one of the forms called (or created) in the other?
for example If yes, then the "parent" form can access the other forms controls by prefacing it with the form name for example It should appear in intellisense.
Otherwise you could create a public variable on the form and then assign the value to it through that.
Hope that helps.
Was one of the forms called (or created) in the other?
for example
VB.NET Syntax (Toggle Plain Text)
dim f as new form1 f.show()
VB.NET Syntax (Toggle Plain Text)
f.PictureBox1
Otherwise you could create a public variable on the form and then assign the value to it through that.
Hope that helps.
![]() |
Similar Threads
- Surpressing information in a form, submitted by email (PHP)
- problem with PHP "submit" information form (PHP)
- Setting up a form in PHP (PHP)
- Processing Checkbox Information From A Form (JavaScript / DHTML / AJAX)
- Saving information from .NET webcontol into access(database) (ASP.NET)
- how to pass information from one page to another? (PHP)
- help with form/ display issues (ColdFusion)
- Need Web Based Contact Us Form (PHP)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
Other Threads in the VB.NET Forum
- Previous Thread: ListView DoubleClick wont fire
- Next Thread: Audio VU Meter
| Thread Tools | Search this Thread |
.net .net2008 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic excel exists fade filter forms ftp generatetags html images input insert intel internet listview map mobile module monitor msaccess net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey table temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





