AdvancedHMI Software
General Category => Feature Request => Topic started by: Darrell on July 08, 2019, 10:17:19 PM
-
I was asked this today , so its got me wondering , Is there a way to make a live plc address value show up in the tool tip
-
I tried this out using a DataSubscriber and it actually worked:
Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
ToolTip1.SetToolTip(BasicLabel2, e.Values(0))
End Sub
-
Here is a couple more general examples of how to set a tooltip using a control's MouseHover event:
Private ttip As New ToolTip
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'Show ToolTip window even if the parent control is not active
ttip.ShowAlways = True
ttip.SetToolTip(SquareIlluminatedButton2, "Hello")
End Sub
#Region "ToolTips"
Private Sub SquareIlluminatedButton1_MouseHover(sender As Object, e As EventArgs) Handles SquareIlluminatedButton1.MouseHover
'Show the control's PLCAddressValue
ttip.SetToolTip(SquareIlluminatedButton1, SquareIlluminatedButton1.PLCAddressValue.ToString)
End Sub
Private Sub BasicLabel1_MouseHover(sender As Object, e As EventArgs) Handles BasicLabel1.MouseHover
'Show the driver's IP Address
ttip.SetToolTip(BasicLabel1, "IP Address: " & ModbusTCPCom1.IPAddress.ToString)
End Sub
#End Region
ToolTip shows a text description so any string could be shown.
ToolTip will, by default, be using the MouseHover event so tooltips could be set anywhere else (just like Archie's example shows or the MainForm_Load sub in the code above).