472,378 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 software developers and data experts.

Using axwebbrowser control and thread locking app

When i try to run the program, it just hangs. If i remove the axwebbrowser control it works fine.

Any ideas?

Here is my code:

class1.vb
Expand|Select|Wrap|Line Numbers
  1. Imports System.Windows.Forms
  2. Imports System.Threading
  3.  
  4. Public Class Class1
  5.   Public Shared form1 As New Form1
  6.  
  7.   Shared Sub Main(ByVal Args() As String)
  8.     Dim t2 As Thread
  9.  
  10.     t2 = New Thread(AddressOf screen)
  11.     t2.Start()
  12.  
  13.   End Sub
  14.   Shared Sub screen()
  15.  
  16.     form1.ShowDialog()
  17.   End Sub
  18. End Class
  19.  
Form
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     Inherits System.Windows.Forms.Form
  3.  
  4. #Region " Windows Form Designer generated code "
  5.  
  6.     Public Sub New()
  7.         MyBase.New()
  8.  
  9.         'This call is required by the Windows Form Designer.
  10.         InitializeComponent()
  11.  
  12.         'Add any initialization after the InitializeComponent() call
  13.  
  14.     End Sub
  15.  
  16.     'Form overrides dispose to clean up the component list.
  17.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  18.         If disposing Then
  19.             If Not (components Is Nothing) Then
  20.                 components.Dispose()
  21.             End If
  22.         End If
  23.         MyBase.Dispose(disposing)
  24.     End Sub
  25.  
  26.     'Required by the Windows Form Designer
  27.     Private components As System.ComponentModel.IContainer
  28.  
  29.     'NOTE: The following procedure is required by the Windows Form Designer
  30.     'It can be modified using the Windows Form Designer.  
  31.     'Do not modify it using the code editor.
  32.   Friend WithEvents AxWebBrowser1 As AxSHDocVw.AxWebBrowser
  33.   Friend WithEvents Button1 As System.Windows.Forms.Button
  34.   <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  35.     Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
  36.     Me.AxWebBrowser1 = New AxSHDocVw.AxWebBrowser
  37.     Me.Button1 = New System.Windows.Forms.Button
  38.     CType(Me.AxWebBrowser1, System.ComponentModel.ISupportInitialize).BeginInit()
  39.     Me.SuspendLayout()
  40.     '
  41.     'AxWebBrowser1
  42.     '
  43.     Me.AxWebBrowser1.Enabled = True
  44.     Me.AxWebBrowser1.Location = New System.Drawing.Point(48, 24)
  45.     Me.AxWebBrowser1.OcxState = CType(resources.GetObject("AxWebBrowser1.OcxState"), System.Windows.Forms.AxHost.State)
  46.     Me.AxWebBrowser1.Size = New System.Drawing.Size(300, 150)
  47.     Me.AxWebBrowser1.TabIndex = 0
  48.     '
  49.     'Button1
  50.     '
  51.     Me.Button1.Location = New System.Drawing.Point(440, 72)
  52.     Me.Button1.Name = "Button1"
  53.     Me.Button1.TabIndex = 1
  54.     Me.Button1.Text = "Button1"
  55.     '
  56.     'Form1
  57.     '
  58.     Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  59.     Me.ClientSize = New System.Drawing.Size(584, 272)
  60.     Me.Controls.Add(Me.Button1)
  61.     Me.Controls.Add(Me.AxWebBrowser1)
  62.     Me.Name = "Form1"
  63.     Me.Text = "Form1"
  64.     CType(Me.AxWebBrowser1, System.ComponentModel.ISupportInitialize).EndInit()
  65.     Me.ResumeLayout(False)
  66.  
  67.   End Sub
  68.  
  69. #End Region
  70.  
  71.   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  72.     'Me.AxWebBrowser1.Navigate("http://www.ibm.com")
  73.   End Sub
  74. End Class
Oct 9 '08 #1
1 1279
debasisdas
8,127 Expert 4TB
question moved to .net forum
Oct 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Lecture Snoddddgrass | last post by:
Hi, I noticed that my WinForms app was taking a while to start up. I stepped through the code to find out which line was causing the delay. The delay is occurring within one of my UserControls...
11
by: Doug Thews | last post by:
I've been working on some samples that use BeginInvoke/EndInvoke. In one example, I call BeginInvoke and pass it an AsyncCallback function pointer. I was messing around with ReaderWriterLocks and...
2
by: Andy Heitke | last post by:
My problem is similar to the thread entited, "SP2 kills my AxWebBrowser" except that I haven't been able to get the fixes to work for me. I've written an application that uses an embedded...
1
by: Mantorok | last post by:
Hi Is there anyway to get a WebBrowser to work without placing it on a form. I want to be able to instantiate a browser, complete some of the fields and submit, but whenever I try to navigate...
0
by: beau | last post by:
Hi, I'm using the AxWebBrowser in a C# WinForms application. I've got the basics working, but need some help controlling the view options for browsing files. How can I disable the...
1
by: MPR | last post by:
I'm displaying a web page with the navigate2 method of the axWebBrowser control. On the web page that is already in the axWebBrowser control, there are severla links, like in any other web page....
13
by: Udhay | last post by:
I am trying to use the AxWebbrowser control in my VB.Net application. The control is placed on one of the tab pages in the form. This is the error I am getting when I have the 'exceptions' set to...
6
by: Dave Booker | last post by:
It appears that I cannot correctly install the AxWebBrowser in VS2005. I can instantiate an "AxWebBrowser browser" and refer to its members, properties, and methods. I'm having trouble with the...
6
by: Gina_Marano | last post by:
Hey All, I am using multiple child threads per main thread to download files. It sometimes appears as if the same file is being downloaded twice. I am using "lock". Am I using it correctly? Any...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.