Get Control On A Form

  • Thread starter Thread starter shachar
  • Start date Start date
S

shachar

hi all.
i have a function that recievs 2 parameters.
1) a reference to a form
2) a name of a pictureBox on the form.
i want to set the image prop' of the picturebox on that
form.
i wrote:
public sub xx(frm as form,PicBoxName as string)
frm(PicBoxName).image=....
end sub
BUT it wont work!!
how should i write it?
 
Shachar,

It looks for me strange, however I give a direct answer on your question,
tell us than what you want to archieve because I am not sure if this direct
answer helps you.

I type it in here, so watch typos.

\\\
public sub xx(frm as form,PicBoxName as string)
for each ctr as control in frm.controls
if ctr.name = PicBoxName then
directcast(ctr, Picturebox).image = image.fromfile(path)
next
end sub
///

I hope this helps so far?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top