【VB开源代码栏目提醒】:本文主要为网学会员提供frmCustomSharp.frm,希望对需要frmCustomSharp.frm网友有所帮助,学习一下!
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmCustomSharp
Caption = "设置锐化程度"
ClientHeight = 2325
ClientLeft = 4365
ClientTop = 4065
ClientWidth = 3510
ControlBox = 0 'False
LinkTopic = "Form4"
ScaleHeight = 2325
ScaleWidth = 3510
Begin MSComctlLib.Slider Slider1
Height = 615
Left = 240
TabIndex = 2
Top = 840
Width = 2895
_ExtentX = 5106
_ExtentY = 1085
_Version = 393216
SelStart = 3
Value = 5
End
Begin VB.TextBox Text1
Height = 270
Left = 2160
TabIndex = 4
Text = "50%"
Top = 360
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2160
TabIndex = 3
Top = 1800
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 360
TabIndex = 1
Top = 1800
Width = 1095
End
Begin
VB.Label Label1
AutoSize = -1 'True
Caption = "锐化程度:"
Height = 180
Left = 360
TabIndex = 0
Top = 360
Width = 900
End
End
Attribute VB_Name = "frmCustomSharp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'确定
Private Sub Command1_Click()
If Len(Text1.Text) > 1 Then
SharpBias = Val(Left(Text1.Text, Len(Text1.Text) - 1))
End If
If SharpBias > 100 Then SharpBias = 100
SharpBias = SharpBias * 2 / 100
SharpCancle = False
Unload frmCustomSharp
End Sub
'取消
Private Sub Command2_Click()
SharpCancle = True
Unload frmCustomSharp
End Sub
'滑块值改变
Private Sub Slider1_Change()
Text1.Text = Str(Slider1.Value) & "%"
Text1.Text = Trim(Text1.Text)
End Sub
'控制输入正确数值
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode > 57 Or KeyCode < 48 Then
MsgBox ("请输入数字!")
Text1.Text = ""
Exit Sub
End If
If Right(Text1.Text, 1) <> "%" Then Text1.Text = Text1.Text & "%"
If Len(Text1.Text) = 1 Then Text1.Text = ""
If Len(Text1.Text) > 4 Then Text1.Text = "100%"
End Sub