Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub cmdPlayer_Click()
If SomeCondition Then
MsgBox "It is NOT your turn, you ^&%#"
Exit Sub
End If
....[green]'Your regular code goes here
[/green]
End Sub
If SomeCondition Then
Set Command1.DownPicture = LoadPicture("C:\Graphics\scowlingface.jpg")
else
Set Command1.DownPicture = LoadPicture("C:\Graphics\NormalPicture.jpg") 'or a different pic again
exit sub
end if
If SomeCondition Then
Set Command1.DownPicture = LoadPicture("C:\Graphics\scowlingface.jpg")
Exit sub
else
Set Command1.DownPicture = LoadPicture("C:\Graphics\NormalPicture.jpg") 'or a different pic again
'... normal code here
end if
'courtesy of various contributors to Tek-tips
Option Explicit
Private Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2&
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
Private Sub Form_Load()
Dim dwExStyle As Long
Dim Success As Integer
' Set up a transparent window
dwExStyle = GetWindowLong(hWnd, GWL_EXSTYLE)
dwExStyle = dwExStyle Or WS_EX_LAYERED
SetWindowLong hWnd, GWL_EXSTYLE, dwExStyle
BackColor = RGB(0, 0, 0) ' this is what will be transparant
SetLayeredWindowAttributes hWnd, RGB(0, 0, 0), 0, LWA_COLORKEY
Success = SetWindowPos(frmIndicator.hWnd, -1, 0, 0, 0, 0, 1) 'always on top of previous loaded forms or applications so it doesn't dissappear when you click on the form
End Sub
Microsoft said:Enabled is better than disabled. Disabled controls are often confusing, so use them only when users can easily deduce why the control is disabled. Otherwise, remove the control if it doesn't apply or leave it enabled and give helpful feedback.