www.pudn.com > 改变计算机屏幕大小的控件.zip > ChangeResolutionForm.frm
VERSION 5.00
Object = "{6FF9A514-A943-11D2-8D43-F90F0D71B6F6}#1.0#0"; "CHANGERES.OCX"
Begin VB.Form ChangeResolutionForm
Caption = "ChangeRes ActiveX Control Demo"
ClientHeight = 4650
ClientLeft = 60
ClientTop = 375
ClientWidth = 5910
LinkTopic = "Form1"
ScaleHeight = 4650
ScaleWidth = 5910
StartUpPosition = 3 'Windows Default
Begin ChangeResProject.ChangeRes ChangeRes1
Left = 1800
Top = 480
_ExtentX = 1005
_ExtentY = 1085
GetMonitorInfo = -1 'True
ChangeResolution= -1 'True
DeviceDescription= "Super VGA 800x600"
MonitorDriver = "Monitor\0000"
HardwareID = "MonID_800"
Manufacture = "(Standard monitor types)"
Xpixels = 800
Ypixels = 600
End
Begin VB.CommandButton NewSettingCommand
Caption = "Set the monitor"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3240
TabIndex = 17
Top = 3840
Width = 2415
End
Begin VB.TextBox NewWidth
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1440
TabIndex = 16
Top = 3720
Width = 1455
End
Begin VB.TextBox NewHeight
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1440
TabIndex = 15
Top = 4080
Width = 1455
End
Begin VB.Label Label9
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "New Height"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 14
Top = 4080
Width = 1455
End
Begin VB.Label Label8
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "New Width"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 13
Top = 3720
Width = 1455
End
Begin VB.Line Line4
X1 = 0
X2 = 5880
Y1 = 3480
Y2 = 3480
End
Begin VB.Line Line3
BorderColor = &H00E0E0E0&
X1 = 0
X2 = 5880
Y1 = 3600
Y2 = 3600
End
Begin VB.Label HeightLabel
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 2160
TabIndex = 12
Top = 2880
Width = 1215
End
Begin VB.Label WidthLabel
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 2160
TabIndex = 11
Top = 2520
Width = 1215
End
Begin VB.Label ManufactureLabel
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 2160
TabIndex = 10
Top = 2160
Width = 3735
End
Begin VB.Label HardwareIDLabel
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 2160
TabIndex = 9
Top = 1800
Width = 3735
End
Begin VB.Label DeviceDescriptionLabel
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 2160
TabIndex = 8
Top = 1440
Width = 3735
End
Begin VB.Label DeviceDriverLabel
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 2160
TabIndex = 7
Top = 1080
Width = 3735
End
Begin VB.Label Label7
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "Height"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 6
Top = 2880
Width = 2175
End
Begin VB.Label Label6
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "Width"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 5
Top = 2520
Width = 2175
End
Begin VB.Label Label5
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "Manufacture type"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 4
Top = 2160
Width = 2175
End
Begin VB.Label Label4
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "Hardware ID"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 3
Top = 1800
Width = 2175
End
Begin VB.Label Label3
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "Device Description"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 2
Top = 1440
Width = 2175
End
Begin VB.Label Label2
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "Display Driver"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 1
Top = 1080
Width = 2175
End
Begin VB.Line Line2
BorderColor = &H00E0E0E0&
X1 = 0
X2 = 5880
Y1 = 840
Y2 = 840
End
Begin VB.Line Line1
X1 = 0
X2 = 5880
Y1 = 720
Y2 = 720
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "Your Display information"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 0
Top = 0
Width = 5895
End
End
Attribute VB_Name = "ChangeResolutionForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
ChangeRes1.GetMonitorInfo = True
DeviceDescriptionLabel.Caption = ChangeRes1.DeviceDescription
DeviceDriverLabel.Caption = ChangeRes1.MonitorDriver
HardwareIDLabel.Caption = ChangeRes1.HardwareID
ManufactureLabel.Caption = ChangeRes1.Manufacture
HeightLabel.Caption = ChangeRes1.Ypixels
WidthLabel.Caption = ChangeRes1.Xpixels
End Sub
Private Sub NewSettingCommand_Click()
ChangeRes1.Xpixels = Val(NewWidth.Text)
ChangeRes1.Ypixels = Val(NewHeight.Text)
ChangeRes1.ChangeResolution = True
If ChangeRes1.Error = True Then
MsgBox "Resolution of your monitor can not changed to " + NewWidth.Text + "X" + NewHeight.Text
End If
End Sub