Author Topic: Hover mouse over component to show PLCAddressValue  (Read 1874 times)

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Hover mouse over component to show PLCAddressValue
« on: October 27, 2014, 04:03:33 PM »
I would like Hover mouse over a component and have the  PLCAddressValue  show ,  in order to quickly verify what is being read on my HMI , I would like to do this for more than one component on the the screen ,  I've spent the better part of my day playing with this and and can seem to get something to work ,  If someone could point me in the right direction , it would be very much appreciated

Thanks Darrell

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Hover mouse over component to show PLCAddressValue
« Reply #1 on: October 27, 2014, 04:20:01 PM »
From the ToolBox add a ToolTip to your form, it will go down into the component tray.

Double click a BasicLabel to get back to the code.
At the top you will see 2 drop downs, one will be the object (BasicLabel) and the other will be the event
Change the event to MouseHover

Add this code:
Code: [Select]
Private Sub BasicLabel1_MouseHover(sender As Object, e As EventArgs) Handles BasicLabel1.MouseHover
  Try
        ToolTip1.SetToolTip(sender, sender.PLCAddressValue)
  catch ex as exception
  end try
End Sub

You can then add after "MouseHover" a comma followed by more objects (e.g.  BasicLabel2.MouseHover, BasicLabel3.MouseHover)

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: Hover mouse over component to show PLCAddressValue
« Reply #2 on: October 27, 2014, 04:37:30 PM »
Thanks man,  worked like a charm

Darrell


Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: Hover mouse over component to show PLCAddressValue
« Reply #3 on: October 30, 2014, 08:55:17 PM »
when I tried this it was in a regular vb form and it seemed to work fine  but when I tried in advanceHMI ,   I get this error

'ToolTip1' is not declared. It may be inaccessible due to its protection level.   

not sure what it means

thanks
Darrell

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Hover mouse over component to show PLCAddressValue
« Reply #4 on: October 30, 2014, 08:57:55 PM »
Is "ToolTip1" the exact name of the tool tip as it shows in the component tray?

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: Hover mouse over component to show PLCAddressValue
« Reply #5 on: October 30, 2014, 11:18:11 PM »
Little things that drive you crazy sometimes , forgot to add the tool tip to the component tray ,

all is good now
thanks