home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form GetValueFrm
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Dialog
- Caption = "GetValue"
- ClientHeight = 2250
- ClientLeft = 2625
- ClientTop = 2655
- ClientWidth = 4815
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2250
- ScaleWidth = 4815
- Begin VB.CheckBox Resize_Horz
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Resize/Horizontal"
- ForeColor = &H80000008&
- Height = 315
- Left = 240
- TabIndex = 5
- Top = 1080
- Width = 2010
- End
- Begin VB.TextBox GetValueBox
- Appearance = 0 'Flat
- Height = 330
- Left = 240
- MaxLength = 7
- TabIndex = 3
- Text = "Text1"
- Top = 525
- Width = 735
- End
- Begin VB.HScrollBar GetValueBar
- Height = 285
- Left = 1200
- TabIndex = 2
- Top = 540
- Width = 3375
- End
- Begin VB.CommandButton Cancel
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Cancel = -1 'True
- Caption = "Cance&l"
- Height = 480
- Left = 2625
- TabIndex = 1
- Top = 1575
- Width = 1215
- End
- Begin VB.CommandButton OK
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "&OK"
- Default = -1 'True
- Height = 480
- Left = 975
- TabIndex = 0
- Top = 1575
- Width = 1215
- End
- Begin VB.Label GetValueType
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Label1"
- ForeColor = &H80000008&
- Height = 270
- Left = 240
- TabIndex = 4
- Top = 240
- Width = 4350
- End
- Attribute VB_Name = "GetValueFrm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim fValueChanged As Integer
- Private Sub Cancel_Click()
- End Sub
- Private Sub Form_Activate()
- GetValueBox.SetFocus
- GetValueBox.SelStart = 0
- GetValueBox.SelLength = Len(GetValueBox.Text)
- End Sub
- Private Sub Form_Load()
- fValueChanged = False
- left = (Screen.Width - Width) / 2
- top = (Screen.Height - Height) / 2
- End Sub
- Private Sub GetValueBar_Change()
- If fValueChanged = False Then
- fValueChanged = True
- GetValueBox.Text = CStr(GetValueBar.Value)
- End If
- fValueChanged = False
- End Sub
- Private Sub GetValueBox_Change()
- If fValueChanged = False Then
- fValueChanged = True
- If Len(GetValueBox.Text) > 0 Then
- If Val(GetValueBox.Text) <= GetValueBar.Max And Val(GetValueBox.Text) >= GetValueBar.Min Then
- GetValueBar = Val(GetValueBox.Text)
- Else
- GetValueBox.Text = left(GetValueBox.Text, Len(GetValueBox.Text) - 1)
- GetValueBox.SelStart = Len(GetValueBox.Text)
- End If
- End If
- End If
- fValueChanged = False
- End Sub
- Private Sub GetValueBox_GotFocus()
- GetValueBox.SelStart = 0
- GetValueBox.SelLength = Len(GetValueBox.Text)
- End Sub
- Private Sub OK_Click()
- If Len(GetValueBox.Text) > 0 Then
- If Val(GetValueBox.Text) <= GetValueBar.Max And Val(GetValueBox.Text) >= GetValueBar.Min Then
- gfGetValueGo = True
- gnGetValueValue = GetValueBar.Value
- Hide
- End If
- End If
- End Sub
-