In my program I'm doing a computer menu.In my assignment it asks to make a mini form appear with a pic of the item when clicked(button). it also so ask when the mini form appears theres an option button on it which lets you go back to form 1. Pl z Help Me ASAP!!!
I Use:
Radio buttons,
check boxes,
form1, form2
buttons
picturebox
4 Replies - 773 Views - Last Post: 21 September 2012 - 06:56 AM
#1
button click in form 1 to display picture in form 2
Posted 17 September 2012 - 05:57 PM
Replies To: button click in form 1 to display picture in form 2
#2
Re: button click in form 1 to display picture in form 2
Posted 17 September 2012 - 07:33 PM
just write (i assume form 2 appear with picturebox):
form2.[picturebox name].picture = loadpicture([picture path])
for example
picture box name : picture1
picture path name : C:\picture.jpg
then u should write like this
form2.[picturebox name].picture = loadpicture([picture path])
for example
picture box name : picture1
picture path name : C:\picture.jpg
then u should write like this
form2.picture1.picture = loadpicture("C:\picture.jpg")
#3
Re: button click in form 1 to display picture in form 2
Posted 17 September 2012 - 07:37 PM
leixnt, on 17 September 2012 - 07:33 PM, said:
just write (i assume form 2 appear with picturebox):
form2.[picturebox name].picture = loadpicture([picture path])
for example
picture box name : picture1
picture path name : C:\picture.jpg
then u should write like this
form2.[picturebox name].picture = loadpicture([picture path])
for example
picture box name : picture1
picture path name : C:\picture.jpg
then u should write like this
form2.picture1.picture = loadpicture("C:\picture.jpg")
zaino131, on 17 September 2012 - 07:36 PM, said:
leixnt, on 17 September 2012 - 07:33 PM, said:
just write (i assume form 2 appear with picturebox):
form2.[picturebox name].picture = loadpicture([picture path])
for example
picture box name : picture1
picture path name : C:\picture.jpg
then u should write like this
form2.[picturebox name].picture = loadpicture([picture path])
for example
picture box name : picture1
picture path name : C:\picture.jpg
then u should write like this
form2.picture1.picture = loadpicture("C:\picture.jpg")
ok ill try and tell you if it works.It does work without me making a series of forms right
#4
Re: button click in form 1 to display picture in form 2
Posted 17 September 2012 - 07:52 PM
leixnt, on 17 September 2012 - 07:33 PM, said:
just write (i assume form 2 appear with picturebox):
form2.[picturebox name].picture = loadpicture([picture path])
for example
picture box name : picture1
picture path name : C:\picture.jpg
then u should write like this
form2.[picturebox name].picture = loadpicture([picture path])
for example
picture box name : picture1
picture path name : C:\picture.jpg
then u should write like this
form2.picture1.picture = loadpicture("C:\picture.jpg")
This Is were im placing it were my one of my radio button is:
Private Sub rad5Ghz_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rad5Ghz.Click
lblcpuSpeed.Enabled = False
Me.Show()
frm5Ghz.Show()
frm5Ghz.pic5Ghz.picture = loadpicture("F:\Visual Studio 2008\Pics\Intel.jpg")
End Sub
Error:
'picture' is not a member of 'System.Windows.Forms.PictureBox'
'name' 'loadpicture is not declared'
Ill send My program return out with the fix. Greatly appreciated!!(*Quick note before you replied i went through making series of form to get the task done but i dont think my teacher give me the mark if i do it that way)
CpuSpecs#2.zip (1.39MB)
Number of downloads: 18
This post has been edited by BobRodes: 21 September 2012 - 06:52 AM
Reason for edit:: Please use code tags in future.
#5
Re: button click in form 1 to display picture in form 2
Posted 21 September 2012 - 06:56 AM
The answers that you've been getting are for Visual Basic 6, because you've posted in the VB6 forum. The error you're getting is a .Net error, because the answers that you've been getting don't apply to VB.Net. (There is no LoadPicture statement in VB.Net, for example.) I've moved you to the VB.Net forum, and please make sure that you post any further VB.Net questions you might have to this forum.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|