Code: Select all
Private WithEvents mbtnClose As Stimulsoft.Controls.StiToolButton
...
mbtnClose = TryCast(StiViewerControl1.ToolBar.Controls.Item("tbClose"), Stimulsoft.Controls.StiToolButton)
Thank you.
Code: Select all
Private WithEvents mbtnClose As Stimulsoft.Controls.StiToolButton
...
mbtnClose = TryCast(StiViewerControl1.ToolBar.Controls.Item("tbClose"), Stimulsoft.Controls.StiToolButton)
Code: Select all
'At module level i have mbtnClose variable:
Private WithEvents mbtnClose As Stimulsoft.Controls.StiToolButton
'In the "new" event of the form i assign the reference:
mbtnClose = TryCast(StiViewerControl1.ToolBar.Controls.Item("tbClose"), Stimulsoft.Controls.StiToolButton)
'In 2008.3.311.0 version the mbtnClose remains "nothing", in 2008.2 it worked.
'This is the event:
Private Sub mbtnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mbtnClose.Click
'Closes the form
Me.Close()
End Sub