• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

transparant PictureBox and VB FORM

Hello there

I have a picture box on a VB Form and its has the same size as the size of the form that is when form resize picturBox adjust itself to the full size of form. now what i want is that PictureBox become transparant to the background that is what ever is drawn graphically(Line,circle,pset) is visible through the picturebox and what ever is drawn on picture box is also visible. the idea is that i use the Form to draw the final graphics and use picture box for scratch pad for drawing that is i draw what ever i want on the picture box and when it is final i draw it on the form. in this way i do not have to refrsh the form objects every time there is like mouse move. also i clear the picture box so that when CLS is called only picturebox objects are erased not the form objects. what are the settings and is this possible


Shahzad
0
shahzad73
Asked:
shahzad73
1 Solution
 
DreamMasterCommented:
I'm pretty sure you cannot get the picturebox to be transparent...

Max.
0
 
rspahitzCommented:
It sounds like everything you need is on the form, so you could always make sure that the two are always in synch, then you don't need to make the picturebox invisible:

on image clear: Picture1.Picture = Form.Picture
on update image: Form.Picture = Picture1.Picture

The picturebox is a container and therefore does not support transparency (because of the way containers work, although you could probably write your own to function as needed.)  If you need transparent, you need the imagebox, which does not support drawing.
0
 
shahzad73Author Commented:
okey i think u are right picture box can not be transparant. also i think u misunderstand my requirments. i want what ever is drawn on the VB Form is visible through PictureBox. the idea is that i will draw animated objects which require constant redraw be drawn on PictureBox. in this way i will not redraw backgroun again and again.

is there any way i can do the same with imagebox. is there any way to draw lines, circles and psets on imagebox


Shahzad.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rspahitzCommented:
The only way I can think of to implement your idea is to create on a picturebox, then at various stages transfer the contents to the imagebox, and as necessary place on or extract from the form background.
0
 
dekeldateCommented:
0
 
dekeldateCommented:
Hi shahzad73
I am glad you like the workround I proposed, but am somewhat disapointed with the grade. I feel this is usually an exchange site. If a solution is given as a comment that means I would like some feedback, and would be most glad to clarify. Also if you are going to give such a low grade, maybe clarify with the potential 'winner', they may release your points, rather than receive such a grade.
0
 
dekeldateCommented:
The link I gave basicly explained the problem and then proposed a work-around. This work-around is definetely not as neat as just making the picturebox transparent, and is also not for every situation. My comment was aimed to help you find a solution, not as a solution in
0
 
rspahitzCommented:
FYI Some experts will not assist those who regularly give "C" grades, meaning that your future questions may get less quality answers.  If you would like to correct this issue, drop a zero-point question in the Customer Service topic area and refer to this question.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now