?
Solved

How to create a transparent control clickable itself, not the controls under ?

Posted on 2003-10-26
3
Medium Priority
?
374 Views
Last Modified: 2007-12-19
I'd like to create a transparent control (panel, picturebox ...) that can be clickable when the control is transparent.

I don't want that the controls under my transparent control are clicked (because they are activex controls with their own click properties).

Or if someone know how to bypass an activex context menu !


Thanks in advance for your answer.
0
Comment
Question by:noulouk
2 Comments
 
LVL 2

Accepted Solution

by:
Inteliscape earned 500 total points
ID: 9632896
Transparency in .net is something weird...very much!!! and is not working as it was in VB6 or C/C++
Transparency there is not actually exist in .net is more like copyparent (copy the background of the parent control)
More! For some reason .net will not let you set a form into another form (at least I didn’t) and use the transparent of that form.

I try hard to have a transparent control but the only thing I came up was with these 2 little tricks and here are

First these lines can let you use for background the transparent web color.
You need only 2 lines as you see below


    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()
        '---------------To support transparent color!!!--------------------
        SetStyle(ControlStyles.SupportsTransparentBackColor, True)
        Me.BackColor = Color.Transparent
        '----------------------------------------------------------------------

        'Add any initialization after the InitializeComponent() call
    End Sub




And my other solution was to paint the control above other controls
and here is a link to this - I submitted this a long time ago...early days of .net
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=610&lngWId=10
These 2 I hope will help you :) something to start.


There is no other solution exept if you design a control in VB6 or C/C++ and use it.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10224377
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: Inteliscape {http:#9632896}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month17 days, 7 hours left to enroll

864 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