View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Jialiang Ge [MSFT] Jialiang Ge [MSFT] is offline
external usenet poster
 
Posts: 118
Default Cancel Click on label control

Hello Adrian,

Thank you for the sample xls. I have reproduced the issue that the Label
turns Opaque when it's clicked. Based on my discussion with the Excel
product team, this is a by-design behavior that Transparent controls do not
remain transparent after gaining focus. This is a result of our
semi-windowless control implementation. It uses Label.BackColor to draw the
background after the label is clicked. We are striving to find out some
workarounds, and I hope I can get back to you with a good news as soon as
possible.

Considering this issue is caused by design, it is my pleasure to help send
a wish to our product designers via internal channel. You are also welcome
to add your supplements to make Microsoft products easier and more powerful
to use by submitting a ticket in
https://connect.microsoft.com/VisualStudio
As we strive to capture any and all product feedback so as to ensure that
we are continuously developing Microsoft products to meet customer needs,
feedback such as yours is always taken very seriously.

In addition, here is a small suggestion for your current implementation of
the hover effect.

In the current implementation, the images' zorder will be updated every
time when users move their mouse over the controls. So the mouse icon turns
'busy', which means the CPU is busy with the updating. I'd suggest that we
add a variable to indicate the current status, and update the image zorder
only when necessary. Below is the vba code for your reference:

Private showingImage2 As Boolean

Private Sub Image2_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If showingImage2 Then
Image1.Visible = True
ActiveSheet.Shapes("Image1").ZOrder (msoBringToFront)
Image2.Visible = False
showingImage2 = False
End If
End Sub

Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If Not showingImage2 Then
Image2.Visible = True
ActiveSheet.Shapes("Image2").ZOrder (msoBringToFront)
Image1.Visible = False
showingImage2 = True
End If
End Sub

Hope it helps

Regards,
Jialiang Ge , remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.