Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 523411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:27:34+00:00 2026-05-13T08:27:34+00:00

I wonder if there is a possibility to (visually and functionally) link two controls(components)?

  • 0

I wonder if there is a possibility to (visually and functionally) link two controls(components)? (.NET2)

Simplifying the things, I have two labels – one of them is the main label (it can be deplaced with the mouse) and an other – the description label – it needs to follow the main label on a specified distance.

Also, the description label should be able to respond to the events, like mouse click etc.
Maybe there is a possibility to use a UserControl but between the labels I need to be a “transparent” space.

Thanks.

==EDIT 1==

I could also, instead of creating the second label control, just use a eternal toolTip. In this case i wonder about possibility of displaying it the Infinite time AND also possibility to detect the click on the tooltip.

Anyway, If I click on the label or tooltip, I will need to display to the user a TextBox control(instead of the tooltip or label), in order that it be able to Modify the displayed description (in fact displaying time)

== EDIT 2 ==

alt text http://lh4.ggpht.com/_1TPOP7DzY1E/Sy9Mk8-Z-xI/AAAAAAAACzo/-5huzSd59j4/s800/UserControl.png

this is my “transperent” UserControl design

alt text http://lh5.ggpht.com/_1TPOP7DzY1E/Sy9MlM31jUI/AAAAAAAACzs/xIJ0hcgOzwo/s800/UserControlForm.png

and this is my Form in running mode(user control “transparent” region covering a button).

this is the usercontrol’s code:

using System;
using System.Windows.Forms;
using System.Drawing;

namespace WindowsControlLibrary1
{
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }

        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x00000020;//WS_EX_TRANSPARENT
                return cp;
            }
        }

        private int opacity;
        public int Opacity
        {
            get { return opacity; }
            set
            {
                opacity = value;
                this.InvalidateEx();
            }
        }

        protected override void OnPaintBackground(PaintEventArgs e)
        {
            Color bk = Color.FromArgb(Opacity, this.BackColor);
            e.Graphics.FillRectangle(new SolidBrush(bk), e.ClipRectangle);
        }

        protected void InvalidateEx()
        {
            if (Parent == null)
                return;
            Rectangle rc = new Rectangle(this.Location, this.Size);
            Parent.Invalidate(rc, true);
        }

        private void label1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.Location = this.Location + (Size)e.Location;
            }
        }

        Point cursorDownPoint = Point.Empty;
        private void label1_MouseDown(object sender, MouseEventArgs e)
        {
            cursorDownPoint = label1.PointToScreen(e.Location);
        }
    }
}

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

* The description was a little simplified. In my real case I have a custom circular point component (: from Microsoft.VisualBasic.PowerPacks.OvalShape). The point represents a object in time position – in the linked label I need to specify the point’s time. User will be able to modify the point’s time by clicking on the time label.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:27:34+00:00Added an answer on May 13, 2026 at 8:27 am

    Create a User Control. A workaround for the transparency issue is outlined here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 385k
  • Answers 385k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To be honest I think this is a lot like… May 14, 2026 at 11:29 pm
  • Editorial Team
    Editorial Team added an answer If you want to remove lines containing any whitespace (tabs,… May 14, 2026 at 11:29 pm
  • Editorial Team
    Editorial Team added an answer Just use .find(): Get the descendants of each element in… May 14, 2026 at 11:29 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.