By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,395 Members | 2,513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,395 IT Pros & Developers. It's quick & easy.

Transparent Controls

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a

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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.