473,705 Members | 4,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 OnPaintBackgrou nd 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.F romArgb( 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 3101

try this,

this.SetStyle(C ontrolStyles.Su pportsTranspare ntBackColor,tru e);
this.BackColor = Color.Transpare nt;

"Steve Koon" <sk***@video-mation.com> wrote in message
news:u5******** ********@TK2MSF TNGP10.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 OnPaintBackgrou nd 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.F romArgb( 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*********@gm ail.com> wrote in message
news:O9******** ******@TK2MSFTN GP14.phx.gbl...

try this,

this.SetStyle(C ontrolStyles.Su pportsTranspare ntBackColor,tru e);
this.BackColor = Color.Transpare nt;

"Steve Koon" <sk***@video-mation.com> wrote in message
news:u5******** ********@TK2MSF TNGP10.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 OnPaintBackgrou nd 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.F romArgb( 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******** ********@TK2MSF TNGP12.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*********@gm ail.com> wrote in message
news:O9******** ******@TK2MSFTN GP14.phx.gbl...

try this,

this.SetStyle(C ontrolStyles.Su pportsTranspare ntBackColor,tru e);
this.BackColor = Color.Transpare nt;

"Steve Koon" <sk***@video-mation.com> wrote in message
news:u5******** ********@TK2MSF TNGP10.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 OnPaintBackgrou nd 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.F romArgb( 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
9501
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 control. My control draws a shape (circle, square, rectangle ...)
2
5394
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
10609
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 some controls that aren't rectangular and it won't be pretty if I end up with a grey rectangle behind each one. http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskGivingYourControlTransparentBackground.asp?frame=true
1
1155
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
10982
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 documentation has reached an all-time low (please note the part about the z-order): MSDN: In Visual Basic 6.0, the BackStyle property of the Label control determines whether the label had a transparent background. Setting the BackStyle...
1
3079
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 picture box set to an icon. The UserControl constructor sets SetStyle( ControlStyles.SupportTransparentBackColor, true); this.BackColor = Color.Transparent; The control does nothing except display the icon.
4
9367
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 written on the glass pane. i need to be able to see the control or form that is underneath the RichTextbox, and at the same time to be able to write and erase text to the RichTextbox. i'm assuming that it is the backcolor that hides what is...
8
10174
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 however shows white as the PictureBox moves but I want it to be transparent. The PictureBox BackColor is set to Transparent .. but no affect. I have used PhotoShop to make the image background transparent .. again no affect. If I make the image a...
0
2865
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 you see in Office 2007. I got it working great, and created a few more controls, including a "VistaButton", which is primarily transparent when the cursor does not hover over it. However, when I added a standard Panel in the VistaGroupBox and put my...
0
8689
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7893
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6605
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4439
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4703
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.