Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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.

Posted
dim i as picturebox
i = new picturebox 'can someone tell me what the difference between that and dim i as new picturebox is?

isn't
dim 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?

 

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.

Posted

the vb formatting screwd up. it should have read:

 

isn't

dim 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?

 

 

 

 

 

 

 

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...