vb.net - change button backgroundcolor or dis/enabled StaticPicture

vb.net - change button backgroundcolor or dis/enabled StaticPicture

jan_tappenbeck
Collaborator Collaborator
816 Views
1 Reply
Message 1 of 2

vb.net - change button backgroundcolor or dis/enabled StaticPicture

jan_tappenbeck
Collaborator
Collaborator

hi !

 

is it possible to Change the button background-Color or dis/enabled a staticpicture by runtime via vb.net?

 

for background i did not found properties!

 

for staticpicture! i try

 

 

Private WithEvents _Img_ProjCurrent As Autodesk.Map.IM.Forms.PictureBox
Private _ImageProjCurrent As String = "$PICAKTUELL"


 Private Sub Dialog_load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
....
 If Me.Dialog.Controls.Contains(_ImageProjCurrent) Then
                _Img_ProjCurrent = CType(Me.Dialog.Controls.ApiItem(_ImageProjCurrent), Autodesk.Map.IM.Forms.PictureBox)
            End If

....
end Sub

here i get the message that the staticimage could not to be convert!

 

 

cound someone help?

 

regards Jan

0 Likes
Accepted solutions (1)
817 Views
1 Reply
Reply (1)
Message 2 of 2

jan_tappenbeck
Collaborator
Collaborator
Accepted solution

here the right way ....

 

Private WithEvents _BT_ProjCurrent As Autodesk.Map.IM.Forms.Button
...

' special color
_BT_ProjCurrent.Desktop.BackColor = Drawing.Color.LightGreen
...

'default Color
_BT_ProjCurrent.Desktop.BackColor = System.Drawing.SystemColors.Control

...
0 Likes