Another option could be to use the enabled property and disable the button, maybe change its text to something else while it is disabled.
See this topic and its "Event - Mouse Down" section that disables the button (Reply #6):
https://www.advancedhmi.com/forum/index.php?topic=1562.msg8438#msg8438
thank you for the help:
Hm, i tried this and it worked well but only for the recipe save button. The recipeButton does not disappear.
In : RecipeButton.vb this is where I put my code: I tried several areas in this sub, nothing seemed to do the trick.
#Region "Events"
Private m_savedText As String = ""
Protected Overrides Sub OnClick(e As EventArgs)
MyBase.OnClick(e)
Me.Visible = False
'* Make sure an INI file was specified
If Not String.IsNullOrEmpty(m_IniFileName) Then
If String.IsNullOrEmpty(RecipeFileError) Then
If m_ComComponent IsNot Nothing Then
For i = 0 To Settings.Count - 1
Try
m_ComComponent.Write(Settings(i).PLCAddress, Settings(i).Value)
Catch ex As Exception
System.Windows.Forms.MessageBox.Show("Faile to write " & Settings(i).Value & " to " & Settings(i).PLCAddress & " ." & ex.Message)
End Try
Next
Else
System.Windows.Forms.MessageBox.Show("ComComponent Property must be set.")
End If
Else
System.Windows.Forms.MessageBox.Show("INI File Error - " & RecipeFileError)
End If
End If
Me.Visible = True
End Sub