Solved

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

Posted on 2003-10-26
3
364 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
3 Comments
 
LVL 2

Accepted Solution

by:
Inteliscape earned 125 total points
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

728 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

9 Experts available now in Live!

Get 1:1 Help Now