Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: Pox1 en Abril 07, 2010, 12:11:37 pm
-
Holas, encontrè un còdigo en planet source creo, en las cuales trabaja con 2 form, en el 1 form contiene 1 richtextbox, 1 textbox() y 2 botones, como esta en la imagen:
(http://img697.imageshack.us/img697/8074/dibujo1jx.jpg)
...de las cuales lo que hace es copiar al richtextbox el còdigo html que dejo en la caja de texto y al momento de dar click en un boton command(código, crea el archivo html) me llama al 2 form que contiene 1 control webbrowser y 1 boton command(Salir y elimina el archivo creado .html) y un control timer...
(http://img266.imageshack.us/img266/6122/dibujo2t.jpg)
dicho codigo copiado al richtextbox se "aplica" en el control webbrowser, viendo el codigo html...en tiempo de diseño ejecuto la aplicación y corre normalmente; pero el problema es que cuando lo compilo (.exe) me da error. Cómo podría hacer para que me corra dicho programa.Se agradece futuras respuestas.
Este es el còdigo:
‘Código Form1
Private Sub Command1_Click()
Open App.Path & "\nmnm.html" For Output As #1
Print #1, RichTextBox1.Text
Close #1
Load Form2
Form2.Show
Form2.brwWebBrowser.Navigate App.Path & "\nmnm.html"
End Sub
Private Sub Form_Load()
End Sub
Código Form2:
Option Explicit
Public StartingAddress As String
Dim mbDontNavigateNow As Boolean
Private Sub Command1_Click()
Form2.Show
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
Me.Show
Form_Resize
If Len(StartingAddress) > 0 Then
'try to navigate to the starting address
timTimer.Enabled = True
brwWebBrowser.Navigate StartingAddress
End If
End Sub
Private Sub brwWebBrowser_DownloadComplete()
On Error Resume Next
Me.Caption = brwWebBrowser.LocationName
End Sub
Private Sub Form_Resize()
brwWebBrowser.Width = Me.ScaleWidth - 400
brwWebBrowser.Width = 7000
End Sub
Private Sub timTimer_Timer()
If brwWebBrowser.Busy = False Then
timTimer.Enabled = False
Me.Caption = brwWebBrowser.LocationName
Else
Me.Caption = "Procesando..."
End If
End Sub
Saludos.
-
Te falto lo mas importante. Publicar el error.