home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form fForm1
- BorderStyle = 1 'Fixed Single
- Caption = "Simulate TextBox By Label - DEMO"
- ClientHeight = 4125
- ClientLeft = 810
- ClientTop = 1800
- ClientWidth = 7365
- ControlBox = 0 'False
- Height = 4530
- Left = 750
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4125
- ScaleWidth = 7365
- Top = 1455
- Width = 7485
- Begin VB.TextBox Text1
- Height = 285
- Left = 360
- TabIndex = 8
- TabStop = 0 'False
- Top = 3120
- Visible = 0 'False
- Width = 615
- End
- Begin VB.CommandButton bExit
- Caption = "&Exit"
- Height = 375
- Left = 3240
- TabIndex = 9
- TabStop = 0 'False
- Top = 3720
- Width = 975
- End
- Begin VB.Label Label2
- BackColor = &H00C0C0C0&
- Caption = "(This field is not enabled, try to click on it...)"
- ForeColor = &H00000000&
- Height = 225
- Index = 4
- Left = 960
- TabIndex = 17
- Top = 2640
- Width = 3135
- End
- Begin VB.Label Label2
- BackColor = &H00C0C0C0&
- Caption = "&Date"
- ForeColor = &H00000000&
- Height = 225
- Index = 0
- Left = 120
- TabIndex = 16
- Top = 2280
- Width = 735
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Caption = "01/01/96"
- Enabled = 0 'False
- Height = 255
- Index = 7
- Left = 960
- TabIndex = 7
- Top = 2280
- Width = 975
- End
- Begin VB.Label Label2
- BackColor = &H00C0C0C0&
- Caption = "&ST"
- ForeColor = &H00000000&
- Height = 225
- Index = 13
- Left = 2760
- TabIndex = 15
- Top = 1920
- Width = 375
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 255
- Index = 6
- Left = 3120
- TabIndex = 6
- Top = 1920
- Width = 375
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Caption = "Brigliadoro"
- Height = 255
- Index = 1
- Left = 960
- TabIndex = 1
- Top = 840
- Width = 3615
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 255
- Index = 2
- Left = 960
- TabIndex = 2
- Top = 1200
- Width = 3615
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 255
- Index = 3
- Left = 960
- TabIndex = 3
- Top = 1560
- Width = 3615
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 255
- Index = 4
- Left = 960
- TabIndex = 4
- Top = 1920
- Width = 1695
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 255
- Index = 5
- Left = 3600
- TabIndex = 5
- Top = 1920
- Width = 975
- End
- Begin VB.Label Label1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Caption = "Silvio"
- Height = 255
- Index = 0
- Left = 960
- TabIndex = 0
- Top = 480
- Width = 3615
- End
- Begin VB.Label Label2
- BackColor = &H00C0C0C0&
- Caption = "&Address"
- ForeColor = &H00000000&
- Height = 225
- Index = 8
- Left = 120
- TabIndex = 14
- Top = 1560
- Width = 735
- End
- Begin VB.Label Label2
- BackColor = &H00C0C0C0&
- Caption = "&City"
- ForeColor = &H00000000&
- Height = 225
- Index = 7
- Left = 120
- TabIndex = 13
- Top = 1920
- Width = 735
- End
- Begin VB.Label Label2
- BackColor = &H00C0C0C0&
- Caption = "&First"
- ForeColor = &H00000000&
- Height = 225
- Index = 3
- Left = 120
- TabIndex = 12
- Top = 480
- Width = 735
- End
- Begin VB.Label Label2
- BackColor = &H00C0C0C0&
- Caption = "&Last"
- ForeColor = &H00000000&
- Height = 225
- Index = 2
- Left = 120
- TabIndex = 11
- Top = 840
- Width = 735
- End
- Begin VB.Label Label2
- BackColor = &H00C0C0C0&
- Caption = "&Company"
- ForeColor = &H00000000&
- Height = 225
- Index = 1
- Left = 120
- TabIndex = 10
- Top = 1200
- Width = 735
- End
- Begin VB.Shape Shape2
- BorderColor = &H00FFFFFF&
- Height = 3540
- Left = 0
- Top = 15
- Width = 7335
- End
- Begin VB.Shape Shape1
- Height = 3540
- Left = 0
- Top = 0
- Width = 7320
- End
- Attribute VB_Name = "fForm1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- '********************************
- 'This is just a demo of a VB 4 application that uses
- 'Label controls to simulate Text controls.
- 'Please note that you MUST set the TABSTOP property
- 'to false for all controls in the form.
- 'Set the TabIndex property for the Labels to the
- 'desidered value. You can use the mouse or the TAB
- 'key to scan all controls. It will act just as if you
- 'had TEXT controls; but notice that they are all labels.
- 'There is 1 hidden (visible=false) text control.
- 'All Comments are Welcome to:
- 'E-MAIL : 103113,352 (Compuserve)
- 'I wrote this utility in just an hour, you could modify it to
- 'accept many more features.
- 'Please note that the frame control isn't a frame control.
- Option Explicit
- Private pCurrentTab As Integer
- Dim i As Integer
- Private Sub bExit_Click()
- End
- End Sub
- Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = 9 Then TabPressed Shift
- End Sub
- Private Sub TabPressed(Shift As Integer)
- 'When need to change tabs do this:
- ' are we going to the next or previous tab?
- If Shift = 0 Then
- 'Next
- pCurrentTab = pCurrentTab + 1
- If pCurrentTab > Label1.Count - 1 Then pCurrentTab = 0
- Else
- 'previous
- pCurrentTab = pCurrentTab - 1
- If pCurrentTab < 0 Then pCurrentTab = Label1.Count - 1
- End If
- 'find index for the current tab
- For i = 0 To Label1.Count - 1
- If pCurrentTab = Val(Label1(i).TabIndex) Then Label1_Click (i)
- Next i
-
- End Sub
- Private Sub Form_Load()
- 'initialize to 1st. possible tab
- pCurrentTab = -1
- SendKeys "{tab}"
- End Sub
- Private Sub Label1_Click(Index As Integer)
- 'al work is done here...
- pCurrentTab = Trim$(Str$(Label1(Index).TabIndex))
- If Label1(pCurrentTab).Enabled = False Then SendKeys "{tab}"
- If Text1.Visible Then
- Label1(Val(Text1.Tag)).Caption = Text1.Text
- Label1(Val(Text1.Tag)).Visible = True
- Text1.Visible = False
- End If
- Text1.Width = Label1(Index).Width
- Text1.Move Label1(Index).Left, Label1(Index).Top
- 'Text1.Height = Label1(Index).Height
- Text1.Tag = Trim$(Str$(Index))
- Label1(Index).Visible = False
- Text1.Text = Label1(Index).Caption
- Text1.Visible = True
- Text1.SetFocus
- End Sub
- Private Sub Text1_KeyCode(KeyCode As Integer, Shift As Integer)
- If KeyCode = 9 Then TabPressed Shift
- End Sub
-