VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Begin VB.Form IEWebBrowser 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Explorador - WEB"
   ClientHeight    =   5370
   ClientLeft      =   150
   ClientTop       =   435
   ClientWidth     =   10320
   Icon            =   "Form_web.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   5370
   ScaleWidth      =   10320
   WindowState     =   2  'Maximized
   Begin ComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   630
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   10320
      _ExtentX        =   18203
      _ExtentY        =   1111
      ButtonWidth     =   741
      ButtonHeight    =   953
      Appearance      =   1
      _Version        =   327682
      BorderStyle     =   1
      Begin ComctlLib.ProgressBar ProgressBar1 
         Height          =   375
         Left            =   6360
         TabIndex        =   8
         Top             =   120
         Width           =   2175
         _ExtentX        =   3836
         _ExtentY        =   661
         _Version        =   327682
         BorderStyle     =   1
         Appearance      =   1
         Max             =   101
      End
      Begin VB.CommandButton Command4 
         Caption         =   "Abrir..."
         Height          =   375
         Left            =   120
         TabIndex        =   6
         Top             =   120
         Width           =   615
      End
      Begin VB.CommandButton Command3 
         Caption         =   "Adelante->"
         Height          =   375
         Left            =   5160
         TabIndex        =   5
         Top             =   120
         Width           =   975
      End
      Begin VB.CommandButton Command2 
         Caption         =   "<-Atrás"
         Height          =   375
         Left            =   4080
         TabIndex        =   4
         Top             =   120
         Width           =   975
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Ir a"
         Height          =   375
         Left            =   840
         TabIndex        =   3
         Top             =   120
         Width           =   495
      End
      Begin VB.ComboBox Combo1 
         Height          =   315
         ItemData        =   "Form_web.frx":2A8B2
         Left            =   1320
         List            =   "Form_web.frx":2A8C8
         TabIndex        =   1
         Top             =   120
         Width           =   2655
      End
   End
   Begin SHDocVwCtl.WebBrowser WebBrowser1 
      Height          =   3975
      Left            =   120
      TabIndex        =   2
      Top             =   960
      Width           =   10095
      ExtentX         =   17806
      ExtentY         =   7011
      ViewMode        =   1
      Offline         =   0
      Silent          =   0
      RegisterAsBrowser=   0
      RegisterAsDropTarget=   0
      AutoArrange     =   -1  'True
      NoClientEdge    =   -1  'True
      AlignLeft       =   0   'False
      NoWebView       =   0   'False
      HideFileNames   =   0   'False
      SingleClick     =   0   'False
      SingleSelection =   0   'False
      NoFolders       =   0   'False
      Transparent     =   0   'False
      ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
      Location        =   ""
   End
   Begin ComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   7
      Top             =   4995
      Width           =   10320
      _ExtentX        =   18203
      _ExtentY        =   661
      SimpleText      =   ""
      _Version        =   327682
      BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
         NumPanels       =   3
         BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Object.Width           =   8819
            MinWidth        =   8819
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Style           =   6
            TextSave        =   "25-10-2006"
            Object.Tag             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   6600
      Top             =   1800
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      DialogTitle     =   "Abrir"
      Filter          =   "HTML (*.htm;*.html)|*.htm*|Texto (*.txt)|*.txt|Imágenes (*.gif;*.jpg)|*.gif;*.jpg*"
   End
   Begin VB.Menu Archivo 
      Caption         =   "Archivo"
      Begin VB.Menu Abrir 
         Caption         =   "Abrir..."
      End
      Begin VB.Menu Salir 
         Caption         =   "Salir"
      End
      Begin VB.Menu DocumentType 
         Caption         =   "Tipo de documento"
      End
   End
End
Attribute VB_Name = "IEWebBrowser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Abrir_Click()
    Command4_Click
End Sub

Private Sub Combo1_Click()
    If Combo1.Text <> WebBrowser1.LocationURL Then
        WebBrowser1.Navigate (Combo1.Text)
    End If
End Sub

Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.Combo1.Text)) Then
    Call Command1_Click
End If


End Sub

Private Sub Command1_Click()
    WebBrowser1.Navigate (Combo1.Text)
End Sub

Private Sub Command2_Click()
    On Error GoTo Salir
    WebBrowser1.GoBack
Salir:
End Sub

Private Sub Command3_Click()
    On Error GoTo Salir
    WebBrowser1.GoForward
Salir:
End Sub

Private Sub Command4_Click()
    CommonDialog1.CancelError = True
    On Error GoTo Salir
    CommonDialog1.ShowOpen
    WebBrowser1.Navigate (CommonDialog1.FileName)
Salir:
End Sub

Private Sub DocumentType_Click()
    MsgBox (WebBrowser1.Type)
End Sub

Private Sub Form_Load()
    WebBrowser1.Navigate (Combo1.Text)
    StatusBar1.Panels(2).Text = Combo1.ListIndex = 0
    ProgressBar1.Value = 50
End Sub

Private Sub Form_Resize()
    WebBrowser1.Left = 0
    WebBrowser1.Top = Toolbar1.Height
    WebBrowser1.Height = IEWebBrowser.ScaleHeight - WebBrowser1.Top - StatusBar1.Height
    WebBrowser1.Width = IEWebBrowser.ScaleWidth
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call menuhabilitado(True)
End Sub

Private Sub Salir_Click()
    End
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
    CommonDialog1.CancelError = True
    On Error GoTo Salir
    CommonDialog1.ShowOpen
    WebBrowser1.Navigate (CommonDialog1.FileName)
Salir:
End Sub

Private Sub WebBrowser1_BeforeNavigate(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Cancel As Boolean)
    IEWebBrowser.MousePointer = vbArrowHourglass
End Sub

Private Sub WebBrowser1_NavigateComplete(ByVal URL As String)
    Combo1.AddItem (WebBrowser1.LocationURL)
    IEWebBrowser.MousePointer = vbDefault
    Combo1.Text = WebBrowser1.LocationURL
    StatusBar1.Panels(2).Text = Combo1.ListIndex = 0 'Combo1.Text
End Sub

Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    IEWebBrowser.MousePointer = vbArrowHourglass
End Sub

Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
    Call WebBrowser1_NavigateComplete(URL)
End Sub

Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
    If (Progress <> -1 And ProgressMax <> 0) Then
        a = (Progress / ProgressMax)
        If a > 1 Then a = 1
        ProgressBar1.Value = 100 * a
        Else
            ProgressBar1.Value = ProgressBar1.Min
    End If
End Sub

