Solved

transparant PictureBox and VB FORM

Posted on 2001-08-29
8
270 Views
Last Modified: 2008-02-01
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
Comment
Question by:shahzad73
8 Comments
 
LVL 19

Expert Comment

by:DreamMaster
Comment Utility
I'm pretty sure you cannot get the picturebox to be transparent...

Max.
0
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
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
 
LVL 1

Author Comment

by:shahzad73
Comment Utility
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
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Accepted Solution

by:
dekeldate earned 30 total points
Comment Utility
0
 
LVL 1

Expert Comment

by:dekeldate
Comment Utility
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
 
LVL 1

Expert Comment

by:dekeldate
Comment Utility
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
 
LVL 22

Expert Comment

by:rspahitz
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now