473,382 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Transparent Controls

Any thoughts on getting this project to work or suggesting another method
would be appreciated.

Steve

==========================================

Project:

A Windows Form which acts as a Whiteboard. The Form contains 3
layered UserControls. The upper most control frame is the 'event_frame'
which handles mouse events. (This frame will handle further events in the
future). The middle frame is the 'drag_frame', which draws out mouse move
events.like dragging mouse boxes on a windows desktop. The bottom frame is
the 'render_frame' which is the main canvas of the whiteboard. On object
creation (after a successful mouse down,drag,up event) the render_frame
would contain the drawing of all current objects.

Problem:
We would like to have all control frames transparent, and yet still be able
to see the contents of the underlying control frames. Currently when one
control is set completely transparent.all controls appear fully transparent
and the underlying form displays through.
Our completed project should have a total transparent event_frame that you
could see through to the render_frame. Upon click on the event_frame.the
event_frame is hidden and the drag_frame becomes visible. (assuming the
mouse is in a down state) You are able to see through the drag_frame to the
render_frame and its contents. As the user drags out a bounding box, the box
is drawn on the drag_frame. Upon mouseup the object is created, the
drag_frame is cleared & hidden, the object is drawn on the render_frame and
the event_frame is visible again.

Solution:

We have successfully set the control styles to allow transparent background
colors and overridden the OnPaintBackground events. This provides some of
the effect we would like to achieve, however we still cannot see the
contents of the control frames underneath each other.

Secondary Question:

Is there any way to flush out, clear or dispose of a Graphics object
without using the .Clear(Color) method? This method simply fills the entire
object with a given color, we would like a way to simply clear the data in
the graphics object and start anew.or something similar to using
*.Clear(Color.FromArgb( 0, Color.White )) This uses an Alpha value of 0 to
hopefully achieve a completely transparent effect.but when we use this the
screen is completely Black.not transparent.


Nov 17 '05 #1
3 3084

try this,

this.SetStyle(ControlStyles.SupportsTransparentBac kColor,true);
this.BackColor = Color.Transparent;

"Steve Koon" <sk***@video-mation.com> wrote in message
news:u5****************@TK2MSFTNGP10.phx.gbl...

Any thoughts on getting this project to work or suggesting another method
would be appreciated.

Steve

==========================================

Project:

A Windows Form which acts as a Whiteboard. The Form contains 3
layered UserControls. The upper most control frame is the 'event_frame'
which handles mouse events. (This frame will handle further events in the
future). The middle frame is the 'drag_frame', which draws out mouse move
events.like dragging mouse boxes on a windows desktop. The bottom frame is
the 'render_frame' which is the main canvas of the whiteboard. On object
creation (after a successful mouse down,drag,up event) the render_frame
would contain the drawing of all current objects.

Problem:
We would like to have all control frames transparent, and yet still be
able to see the contents of the underlying control frames. Currently when
one control is set completely transparent.all controls appear fully
transparent and the underlying form displays through.
Our completed project should have a total transparent event_frame that you
could see through to the render_frame. Upon click on the event_frame.the
event_frame is hidden and the drag_frame becomes visible. (assuming the
mouse is in a down state) You are able to see through the drag_frame to
the render_frame and its contents. As the user drags out a bounding box,
the box is drawn on the drag_frame. Upon mouseup the object is created,
the drag_frame is cleared & hidden, the object is drawn on the
render_frame and the event_frame is visible again.

Solution:

We have successfully set the control styles to allow transparent
background colors and overridden the OnPaintBackground events. This
provides some of the effect we would like to achieve, however we still
cannot see the contents of the control frames underneath each other.

Secondary Question:

Is there any way to flush out, clear or dispose of a Graphics object
without using the .Clear(Color) method? This method simply fills the
entire object with a given color, we would like a way to simply clear the
data in the graphics object and start anew.or something similar to using
*.Clear(Color.FromArgb( 0, Color.White )) This uses an Alpha value of 0 to
hopefully achieve a completely transparent effect.but when we use this the
screen is completely Black.not transparent.




Nov 17 '05 #2
Unfortunately this was one of the very first things We did, and it's of no
use. The problem isn't necessarily making it 'transparent' but to function
in a transparent fashion. Using this, the effect is seeing through
EVERYTHING all the way down to the form, not what we want. We would like the
effect to stop at each layer.

However, We believe using Panels instead of User Controls may be the way to
go. It's a little bit more trouble to integrate, since they don't inherit as
User Controls do, but they seem to behave just like we would like. I will
let you know how it goes.

Steve

"Rodrigo Ferreira" <rj*********@gmail.com> wrote in message
news:O9**************@TK2MSFTNGP14.phx.gbl...

try this,

this.SetStyle(ControlStyles.SupportsTransparentBac kColor,true);
this.BackColor = Color.Transparent;

"Steve Koon" <sk***@video-mation.com> wrote in message
news:u5****************@TK2MSFTNGP10.phx.gbl...

Any thoughts on getting this project to work or suggesting another method
would be appreciated.

Steve

==========================================

Project:

A Windows Form which acts as a Whiteboard. The Form contains 3
layered UserControls. The upper most control frame is the 'event_frame'
which handles mouse events. (This frame will handle further events in the
future). The middle frame is the 'drag_frame', which draws out mouse move
events.like dragging mouse boxes on a windows desktop. The bottom frame
is the 'render_frame' which is the main canvas of the whiteboard. On
object creation (after a successful mouse down,drag,up event) the
render_frame would contain the drawing of all current objects.

Problem:
We would like to have all control frames transparent, and yet still be
able to see the contents of the underlying control frames. Currently when
one control is set completely transparent.all controls appear fully
transparent and the underlying form displays through.
Our completed project should have a total transparent event_frame that
you could see through to the render_frame. Upon click on the
event_frame.the event_frame is hidden and the drag_frame becomes visible.
(assuming the mouse is in a down state) You are able to see through the
drag_frame to the render_frame and its contents. As the user drags out a
bounding box, the box is drawn on the drag_frame. Upon mouseup the object
is created, the drag_frame is cleared & hidden, the object is drawn on
the render_frame and the event_frame is visible again.

Solution:

We have successfully set the control styles to allow transparent
background colors and overridden the OnPaintBackground events. This
provides some of the effect we would like to achieve, however we still
cannot see the contents of the control frames underneath each other.

Secondary Question:

Is there any way to flush out, clear or dispose of a Graphics object
without using the .Clear(Color) method? This method simply fills the
entire object with a given color, we would like a way to simply clear the
data in the graphics object and start anew.or something similar to using
*.Clear(Color.FromArgb( 0, Color.White )) This uses an Alpha value of 0
to hopefully achieve a completely transparent effect.but when we use this
the screen is completely Black.not transparent.




Nov 17 '05 #3
Best to use graphical objects that are not controls ("lite controls"), and
handle painting and hit testing in a single control. This works well if it
is a true whiteboard type of application. A set of Windows Forms controls
will not behave properly this way.
Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor
"Steve Koon" <sk***@video-mation.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Unfortunately this was one of the very first things We did, and it's of no
use. The problem isn't necessarily making it 'transparent' but to function
in a transparent fashion. Using this, the effect is seeing through
EVERYTHING all the way down to the form, not what we want. We would like
the effect to stop at each layer.

However, We believe using Panels instead of User Controls may be the way
to go. It's a little bit more trouble to integrate, since they don't
inherit as User Controls do, but they seem to behave just like we would
like. I will let you know how it goes.

Steve

"Rodrigo Ferreira" <rj*********@gmail.com> wrote in message
news:O9**************@TK2MSFTNGP14.phx.gbl...

try this,

this.SetStyle(ControlStyles.SupportsTransparentBac kColor,true);
this.BackColor = Color.Transparent;

"Steve Koon" <sk***@video-mation.com> wrote in message
news:u5****************@TK2MSFTNGP10.phx.gbl...

Any thoughts on getting this project to work or suggesting another
method would be appreciated.

Steve

==========================================

Project:

A Windows Form which acts as a Whiteboard. The Form contains
3 layered UserControls. The upper most control frame is the
'event_frame' which handles mouse events. (This frame will handle
further events in the future). The middle frame is the 'drag_frame',
which draws out mouse move events.like dragging mouse boxes on a windows
desktop. The bottom frame is the 'render_frame' which is the main canvas
of the whiteboard. On object creation (after a successful mouse
down,drag,up event) the render_frame would contain the drawing of all
current objects.

Problem:
We would like to have all control frames transparent, and yet still be
able to see the contents of the underlying control frames. Currently
when one control is set completely transparent.all controls appear fully
transparent and the underlying form displays through.
Our completed project should have a total transparent event_frame that
you could see through to the render_frame. Upon click on the
event_frame.the event_frame is hidden and the drag_frame becomes
visible. (assuming the mouse is in a down state) You are able to see
through the drag_frame to the render_frame and its contents. As the user
drags out a bounding box, the box is drawn on the drag_frame. Upon
mouseup the object is created, the drag_frame is cleared & hidden, the
object is drawn on the render_frame and the event_frame is visible
again.

Solution:

We have successfully set the control styles to allow transparent
background colors and overridden the OnPaintBackground events. This
provides some of the effect we would like to achieve, however we still
cannot see the contents of the control frames underneath each other.

Secondary Question:

Is there any way to flush out, clear or dispose of a Graphics object
without using the .Clear(Color) method? This method simply fills the
entire object with a given color, we would like a way to simply clear
the data in the graphics object and start anew.or something similar to
using *.Clear(Color.FromArgb( 0, Color.White )) This uses an Alpha value
of 0 to hopefully achieve a completely transparent effect.but when we
use this the screen is completely Black.not transparent.





Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul Schnitter | last post by:
Update: My custom control is based on the article "Creating Visual Basic .NET controls from scratch" in "Adventures in .NET" on MSDN. It is designed to be a replacement for the VB6 shape...
2
by: Raj | last post by:
Hi, Anyone has any idea as to how we can make a button or any standard windows control as transparent or semi-trnasparent. How can we do this in C#? Thanks, Rajendra
8
by: Grahammer | last post by:
Is it possible to set the background of a usercontrol as transparent? I tried setting the background image of the usercontrol to a transparent GIF, but that caused MAJOR problems. I'm making...
1
by: iwdu15 | last post by:
hi, is there anyway to get a label to have a transparent back color so i can see the form behind it? ive tried setting the color to "color.transparent" but that didnt work...any ideas? -- -iwdu15
2
by: Martin | last post by:
I've been complaing about the VB2005 Help-Information (or rather the lack of it) before, but when I was looking how to set the backstyle of a label control to "Transparent" I found that the VB2005...
1
by: FredC | last post by:
I'm using VS 2003, C#.Net 2003. I built a simple windows form app. with the following attributes: - has a BackgroundImage set to a jpeg I built a very simple user control that contains a...
4
by: ray well | last post by:
in my app i need to make a RichTextbox control transparent. i need it to be a like a pane of glass lying on a sheet of paper, where u can see everything on the sheet of paper not covered by text...
8
by: Brian Ward | last post by:
I am looking for a simple way to set the image transparency in a PictureBox. I have a moving PictureBox containing a graphic image .. moving by incrementing its Left property. The background...
0
by: MasterOfTheDark | last post by:
This one's a hairy one to explain. What I've got is a class called "VistaGroupBox" that I put some nice-looking Vista-style gradients in the background and made to look like the ribbon categories...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.