Results 1 to 3 of 3

Thread: Strange Label Behavior

  1. #1

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Question Strange Label Behavior

    A Form has 3 Labels. I want the 3rd Label to look like a hyperlink (clicking the 3rd Label opens another Form). Since I want the 3rd Label to look like a hyperlink, I have even made the cursor change to a hand & the Label underlined when the mouse is moved over the 3rd Label. The hand cursor resides in a resource file. This is the MouseMove event function of the 3rd Label:

    Code:
    Private Sub Label3_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
        Label3.FontUnderline = True
        Label3.ForeColor = vbBlue
        Label3.MouseIcon = LoadResPicture("Hand", vbResCursor)
        Label3.MousePointer = vbCustom
    End Sub
    Since users can change the back color of the Form on which these 3 Labels reside, I have set the BackStyle property of all the 3 Labels to Transparent (at design time in the Properties window) but what I find is when the mouse is moved over the 3rd Label, the font of the 1st & 2nd Label becomes bold. If I set the BackStyle of the 3rd Label to Opaque, then this problem doesn't arise. The font of the 1st & 2nd Label becomes bold only when the BackStyle of the 3rd Label is set to Transparent & the mouse is moved over the 3rd Label.

    How do I overcome this?
    Last edited by arpan_de; Jan 7th, 2008 at 02:30 AM.


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  2. #2

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Re: Strange Label Behavior

    Well I could overcome the problem by replacing the 3rd Label with a TextBox but would still like to know why was the transparency of the 3rd Label affecting the font-weight of the 1st 2 Labels when the mouse was moved over the 3rd Label?


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Strange Label Behavior

    I have no idea why you have this problem, it shouldn't happen. However may I suggest replacing all three labels (if they are grouped together) with one HyperLabel control instead? To get the transparant background set the Visible property to False and the RenderToContainer property to True.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width