StreaksAthlete Posted August 14, 2005 Posted August 14, 2005 i am using this code to add a picturebox to my form and perform a drag drop operation. But when i run the form, nothing shows up. I need some help, PLEASE. Dim i as New Picturebox Me.Controls.Add(i) i.Visible = True i.Image = imgFloor.Image'Another Picture on my form" i.Left = 10 i.Top = 10 Quote
thenerd Posted August 14, 2005 Posted August 14, 2005 dim i as picturebox i = new picturebox 'can someone tell me what the difference between that and dim i as new picturebox is? i.visible = true i.image = imgfloor.image i.left = 10 i.top = 10 'now you add it me.controls.add(i) '<shrug> just in case me.refresh I think that will do it. You were adding and then changing i's properties. Once you've added, the form has its own copy of i, you can change i all you want, but it won't make a difference. Quote
Joe Mamma Posted August 15, 2005 Posted August 15, 2005 dim i as picturebox i = new picturebox 'can someone tell me what the difference between that and dim i as new picturebox is? isn'tdim i as picturebox = new picturebox the equivalent of [indent] dim i as picturebox i = new picturebox [/indent] I don't think you can do dim i as new picturebox in vb.not, can you? Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Joe Mamma Posted August 15, 2005 Posted August 15, 2005 the vb formatting screwd up. it should have read: isn'tdim i as picturebox = new picturebox the equivalent of [indent]dim i as picturebox i = new picturebox [/indent] I don't think you can do dim i as new picturebox in vb.not, can you? Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
penfold69 Posted August 15, 2005 Posted August 15, 2005 Yes, you CAN do: Dim i as New PictureBox B. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.