VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Returns the resolution of the monitor, and has a neat button color changer built in

by joe montgomery (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 12th February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Returns the resolution of the monitor, and has a neat button color changer built in

Rate Returns the resolution of the monitor, and has a neat button color changer built in



'1 command button 'YOU MUST SET THE COMMAND BUTTON TO GRAPHICAL
Option Explicit
Dim intWidth As Integer
Dim intHeight As Integer
Private Sub Command1_Click()
If Command1 Then
'tells windows to change the color of the button when its been clicked
Command1.BackColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
'setup to get the res
intWidth = Screen.Width \ Screen.TwipsPerPixelX
intHeight = Screen.Height \ Screen.TwipsPerPixelY
MsgBox "Screen Resolution:" + vbCrLf + vbCrLf + Str$(intWidth) + " x" + Str$(intHeight), 64, "Info"
End If
End Sub

Private Sub Picture1_Click()
If Picture1 Then
'close the program where me = form1
Unload Me
End If
End Sub

Download this snippet    Add to My Saved Code

Returns the resolution of the monitor, and has a neat button color changer built in Comments

No comments have been posted about Returns the resolution of the monitor, and has a neat button color changer built in. Why not be the first to post a comment about Returns the resolution of the monitor, and has a neat button color changer built in.

Post your comment

Subject:
Message:
0/1000 characters