Author Topic: BasicLable double click  (Read 1124 times)

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
BasicLable double click
« on: August 09, 2018, 04:13:14 PM »
Hi. Using Ver 339yBeta12 On the main form on any of the BasicLabel’s when I double click on them I thought it would take me to the items click event in the code. It doesn’t it just stays on the form??????

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: BasicLable double click
« Reply #1 on: August 09, 2018, 06:39:57 PM »
If you check the code of the BasicLabel, you will see that the DefaultEvent is set to no event:

Code: [Select]
<System.ComponentModel.DefaultEvent("")>
Public Class BasicLabel
    Inherits System.Windows.Forms.Label

So just change it to Click event:

Code: [Select]
<System.ComponentModel.DefaultEvent("Click")>
Public Class BasicLabel
    Inherits System.Windows.Forms.Label

Then the double-click should work.

Just be aware of the code that already exists for the KeypadPopUp:

Code: [Select]
    '***********************************************************
    '* If the label is clicked, pop up a keypad for data entry
    '***********************************************************
    Protected Overrides Sub OnClick(e As System.EventArgs)
        MyBase.OnClick(e)

        If m_PLCAddressKeypad IsNot Nothing AndAlso (String.Compare(m_PLCAddressKeypad, "") <> 0) And Enabled Then
            ActivateKeypad()
        End If
    End Sub


« Last Edit: August 09, 2018, 06:43:57 PM by Godra »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: BasicLable double click
« Reply #2 on: August 09, 2018, 10:18:35 PM »
This is by design. The majority of users coming from another HMI package will by habit double click a control to get to the properties. I have noticed on many occasions their code will have a large number of empty event handlers. In some rare cases, once they are taken to the code page they do not know what to do. To avoid these issues, I have decided to begin removing default event handlers.

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: BasicLable double click
« Reply #3 on: August 10, 2018, 06:40:05 AM »
Thanks Archie, Works fine now.
Best support in the industry.................